Specifiche

# Import necessary libraries
import pandas as pd

# Define parameters
stop_loss_percentage = 0.02  # Set stop loss percentage (2% in this example)
take_profit_percentage = 0.05  # Set take profit percentage (5% in this example)

# Read historical price data
df = pd.read_csv("historical_data.csv")  # Replace with your historical data file or API integration

# Calculate moving averages
df['SMA_50'] = df['Close'].rolling(window=50).mean()
df['SMA_200'] = df['Close'].rolling(window=200).mean()

# Initialize variables
position = None
entry_price = 0.0

# Start trading loop
for i in range(200, len(df)):
    current_price = df['Close'].iloc[i]

    # Check for entry conditions
    if position is None and df['SMA_50'].iloc[i] > df['SMA_200'].iloc[i]:
        position = 'long'
        entry_price = current_price
        print(f"Enter long position at {entry_price}")

    elif position is None and df['SMA_50'].iloc[i] < df['SMA_200'].iloc[i]:
        position = 'short'
        entry_price = current_price
        print(f"Enter short position at {entry_price}")

    # Check for exit conditions
    if position == 'long' and current_price >= (1 + take_profit_percentage) * entry_price:
        position = None
        exit_price = current_price
        print(f"Exit long position at {exit_price}")
        profit = exit_price - entry_price
        print(f"Profit: {profit}")

    elif position == 'long' and current_price <= (1 - stop_loss_percentage) * entry_price:
        position = None
        exit_price = current_price
        print(f"Exit long position at {exit_price}")
        loss = exit_price - entry_price
        print(f"Loss: {loss}")

    elif position == 'short' and current_price <= (1 - take_profit_percentage) * entry_price:
        position = None
        exit_price = current_price
        print(f"Exit short position at {exit_price}")
        profit = entry_price - exit_price
        print(f"Profit: {profit}")

    elif position == 'short' and current_price >= (1 + stop_loss_percentage) * entry_price:
        position = None
        exit_price = current_price
        print(f"Exit short position at {exit_price}")
        loss = entry_price - exit_price
        print(f"Loss: {loss}")

Con risposta

1
Sviluppatore 1
Valutazioni
(2)
Progetti
2
0%
Arbitraggio
1
0% / 0%
In ritardo
2
100%
Gratuito
2
Sviluppatore 2
Valutazioni
(43)
Progetti
66
12%
Arbitraggio
12
58% / 42%
In ritardo
1
2%
Gratuito
3
Sviluppatore 3
Valutazioni
(35)
Progetti
50
42%
Arbitraggio
3
33% / 33%
In ritardo
4
8%
Gratuito
4
Sviluppatore 4
Valutazioni
(6)
Progetti
10
50%
Arbitraggio
6
17% / 50%
In ritardo
3
30%
In elaborazione
5
Sviluppatore 5
Valutazioni
(5)
Progetti
4
50%
Arbitraggio
4
0% / 75%
In ritardo
0
Gratuito
Ordini simili
Hi. I'm looking for someone to put the code I have into effect as a bot . I'm trading the Aus_200 SFE index ( Not the XJO) The bot is based on MACD entry/exit, RSI, stochastic, & vwap. Once the job is accepted, I have a few adjustments to make; however, nothing major. Thanks
السلام عليكم، مطلوب مطور محترف وخبير في لغة MQL5 لتطوير مستشار خبير (Expert Advisor) مخصص للتداول تلقائياً على معدن الذهب (XAUUSD) ليعمل على منصة MetaTrader 5. ​الشروط المطلوبة: ​الاعتماد على استراتيجية ذكية لإدارة المخاطر (تحتوي على Stop Loss و Take Profit تلقائي وديناميكي). ​إمكانية دمج خوارزميات تحليل ذكية (أو الربط مع بايثون إذا لزم الأمر لتنفيذ منطق الذكاء الاصطناعي). ​توفير خاصية الـ Trailing Stop (ملاحقة
I need an expert advisor for fast excursion of trades. So that I can up my skills, I need it to have a good balance and need you to at least to price the the bot below $50
Brotus AI 32+ USD
And let's talk about Linux and more about those technologies, ideas, those AI ideas.Let's make an AI technology summit for us base on wgat i wanna build and their example pictures of roadmapBoss can we take those idea all we've talked about base on technology, tech, UI...J.A.R.V.I.S...eDEX-UI into reality (solution) using laptop cause I think it give accces to build app amd more
I am looking for an experienced MQL5 developer to code a custom Expert Advisor for MetaTrader 5 based on my own private trading strategy.I have all the specific entry rules, exit conditions, and risk management parameters fully prepared. I will share these exact details with the selected developer via direct message once the job is initiated.The final delivery must include the clean, fully commented source code (.mq5
Hello, I'm interested in a quote to convert my manual trading strategy into an automated strategy for NinjaTrader. Please note, I would like the quote based on the work and not my available budget; therefore, I entered $5 for the budget. Additionally, I would appreciate knowing how long it would take to build/test. I would prefer to have it sooner rather than later but selected 7 days not knowing how long it takes to
I am looking to hire a developer who has a good scalping EA for Gold. The bot must have been tested in a live market and the developer should be willing to send a demo for testing. Pls do not waste time if your EA has not been tested in a live market
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 . The EA performs consistently and profitably on demo accounts , but when I run it on an IC Markets Raw and standard live account , it begins generating losses under what appear to be the same trading conditions. if needed i can provide Full EA source code (.mq4 and/or .mq5) and Set file. I need an experienced MQL4/MQL5 developer to thoroughly
I am looking for an experienced developer to create a custom MT4 Expert Advisor (EA) / trading robot. Requirements: Fully automated trading system for MetaTrader 4 Clear entry and exit strategy (can be based on indicators, price action, or a custom logic) Risk management features (lot size control, stop loss, take profit, trailing stop) Ability to run on multiple currency pairs Option to adjust settings (risk %
I have my own strategy in 1min. I want it convert to a bot. Please reach me only coding experts. I dont want bit makers from Ai. Demo version should be provided for confirmation

Informazioni sul progetto

Budget
30+ USD
Scadenze
da 1 a 2 giorno(i)