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
Valutazioni
Progetti
2
0%
Arbitraggio
1
0%
/
0%
In ritardo
2
100%
Gratuito
2
Valutazioni
Progetti
66
12%
Arbitraggio
12
58%
/
42%
In ritardo
1
2%
Gratuito
3
Valutazioni
Progetti
50
42%
Arbitraggio
3
33%
/
33%
In ritardo
4
8%
Gratuito
4
Valutazioni
Progetti
10
50%
Arbitraggio
6
17%
/
50%
In ritardo
3
30%
In elaborazione
5
Valutazioni
Progetti
4
50%
Arbitraggio
4
0%
/
75%
In ritardo
0
Gratuito
Ordini simili
דרוש כלי ויזואליזציה נקי ופשוט ל-RR (Risk/Reward); ללא לוחות בקרה או עיצוב מורכבים – נדרש עיצוב נקי ומינימליסטי. נא לשלוח דמו (קובץ ex5) הכולל מנגנון נעילת זמן (timelock); המפתח שייבחר ישלים את העבודה וישלח את הקובץ המלא (mq5). תודה ושלום
Looking for a developer in NinjaTrader For coding Inst - ES,NQ Chart type - Tick, range, volume & time Brief- Fib levels mapped on chart which act as entries, tgts and stops all based on candle close. (Maybe) use MACD for filtering direction. Daily manual input of the TWO fib Anchor levels is part of the strategy. I need a well experienced developer to bid and before biding check the attached file well. the PDF and
Експерт по хибному пробою
30 - 50 USD
Потрібен робот, який відкриває відкладені ордери в напрямку, протилежному поточній ринковій ціні (ордер Sell Stop, якщо ринкова ціна вище, і ордер Buy Stop, якщо ринкова ціна нижче). Модельований сценарій – хибний прорив
1- The EA must h ave a unique strategy specialized on make trades with very very low RRR, so basicaly risking 1475$ to make 100$, with an ammount adjustable of trades per day. (This is very important that i wish in 100 trades, it makes a maximum of 10 trades of mistake, maybe less...) 2- The EA must have the strategy specialized on INDEX CFD. 3- The EA must make each trade with more than 3 minutes, and less than 12h
I need an MT4 Expert Advisor (MQL4). 1. Open one Buy and one Sell trade simultaneously. 2. Adjustable lot size (default 0.01). 3. Stop Loss on both trades. 4. If one trade hits Stop Loss: - Do not open a replacement trade. - Leave the remaining trade open. 5. Optional trailing stop: - On/Off switch. - Adjustable distance. 6. When the remaining trade closes: - Open a new Buy and Sell pair. - Repeat continuously
EA based on MACD & HMA crossovers
300+ USD
*JOB TITLE:* `MQL5 EA: 8-Indicator Confluence Bot for XAUUSD, US30, NAS100, DE40 + News + DD Protection` *BUDGET:* $300 - $400 *TIMELINE:* 10 - 14 days *PLATFORM:* MetaTrader 4 & 5 *ATTACHMENTS:* `Indicators.zip` = 10 indicators + 5 screenshots with all settings --- *1. CORE TRADING LOGIC - ON CANDLE CLOSE ONLY* *BUY when ALL conditions are TRUE:* 1. Price > 200 SMA 2. `Reversal Indicator` = UP arrow/dot 3
Hi, I Wanne have a trading robot that give me signals for short buy and sell. And only for all currency in forex trading and also can use it on mt5
I want a scalping Ea robot based on EMA crossover
30 - 200 USD
the bot will be used for xauusd scalp trading , want the bor follow the trading indicator will SL and open another opposite order where i can customize the SL margin and risk management
Modification of an existing MQL5 EA TH-05
30 - 300 USD
I Have an existing Mql5 Expert advisor (source code), I want a professional programmer to help me Modify the EA... so that it can stop taking new trades once it Gets to a Pacific Lots Size or Floating loss
Hi, can you define entry conditions based on 100 or 200 trades? If you need more history, i can give you more trades. It is EURUSD with great results! If you can do it, contact me
Informazioni sul progetto
Budget
30+ USD
Scadenze
da 1 a 2 giorno(i)