指定
# 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}")
応答済み
1
評価
プロジェクト
2
0%
仲裁
1
0%
/
0%
期限切れ
2
100%
暇
2
評価
プロジェクト
66
12%
仲裁
12
58%
/
42%
期限切れ
1
2%
暇
3
評価
プロジェクト
50
42%
仲裁
3
33%
/
33%
期限切れ
4
8%
暇
4
評価
プロジェクト
10
50%
仲裁
6
17%
/
50%
期限切れ
3
30%
仕事中
5
評価
プロジェクト
4
50%
仲裁
4
0%
/
75%
期限切れ
0
暇
類似した注文
PROJECT OVERVIEW I need a production-grade, modular Expert Advisor for MetaTrader 5 built to institutional coding standards. This is not a simple indicator-crossover bot. The system must be object-oriented, fully commented, and structured so individual modules can be replaced or disabled without breaking the build. Broker: IC Markets Raw. Primary symbol: XAUUSD. Secondary validation: EURUSD, GBPUSD, USDJPY, AUDUSD
Hi, do you have a proven EA for MT5, suitable for live accounts and prop firms, including the Brazilian market? I’m looking for ready, tested EAs. Can you send a backtest or demo? Please if you do have and can send me nacktest or demo you should Message me
Flummox 0.1
30+ USD
//@version=5 strategy("Vol10 Triple Confluence M15", overlay=true, margin_long=100, margin_short=100) // === INPUTS === emaLen = input.int(200, "EMA Trend") rsiLen = input.int(14, "RSI Length") bbLen = input.int(14, "Bands Length") rsiOversold = input.float(25, "RSI Buy Zone") rsiOverbought = input.float(77.38, "RSI Sell Zone") // === INDICATORS === emaTrend = ta.ema(close, emaLen) ema1 = ta.ema(close, bbLen) ema2 =
Foxer trading
30 - 500 USD
Automated Forex trading software is generally evaluated by users on independent forums like Forex Peace Army, Myfxbook, and Trustpilot. The highest-rated systems typically fall into three categories, depending on your risk tolerance and trading style: GPS Forex Robot : Famous for its long-term track record on verified Myfxbook accounts. Users praise its steady trend-following logic and its conservative approach
Raydon read
30+ USD
Instead of an answer key, bots use user-defined settings like lot size, stop-loss, take-profit, and unique identifier numbers (magic numbers).Logic Rules: They scan markets for triggers like moving averages, RSI, or MACD.Execution: Trades happen programmatically to remove human emotion
Access and confidentiality restrictions: You will receive only a separately named copy of the Commander . Existing trading EAs, presets, account credentials, Telegram credentials and proprietary entry/exit code will not be shared. The Commander intelligence must be developed using: Defined signal/input interfaces Anonymized historical logs and replay data Mock EA signals and test harnesses Documented authority and
Sharbat Khan
100+ USD
Looking for MQL5 Developer to debug my Gold Trading EA. Issues: - Error on compile - SL/TP not working correctly - Need to add Trail Stop feature Send me past work + Price + Delivery Time
Mopati
30+ USD
need an MQL5 trading robot for Forex. It should open and close trades based on my strategy rules. Please include money management, stop loss, take profit, and lot size settings. The EA should be stable, easy to edit, and tested before delivery. I will share the exact entry and exit rules with the developer
MQL5 Forex Trading Robot Development
30 - 100 USD
I need an MQL5 trading robot for Forex. It should open and close trades based on my strategy rules. Please include money management, stop loss, take profit, and lot size settings. The EA should be stable, easy to edit, and tested before delivery. I will share the exact entry and exit rules with the developer
Hello, I am looking for an experienced MQL5 developer to develop a professional and reliable Expert Advisor (EA) for MetaTrader 5. The EA will be based on a custom automated Forex trading strategy that I have developed and tested. The detailed trading logic and proprietary rules will be provided privately to the selected developer. General requirements: • Development in MQL5 for MetaTrader 5. • The EA will initially
プロジェクト情報
予算
30+ USD
締め切り
最低 1 最高 2 日