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
(42)
Progetti
62
8%
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
I need to create an EA based on my own strategy that actually is a little bit different from most of the usual EA. This because it use an indicator but the power of the system is just because it can shows target price by designing trendline on the price chart in a unusual way. A friend of mine tried to create it on MT4 platform but, in the end, he realized that this platform has big limits when the program lines
Convert my tradingview pine script to mt4, Its a simple and straight code i need an expert programmer to convert my tradingview pine script to mt4, Thats All Thank you
For Chart Panel : Needs a Black Back ground at present its transparent . ✔️ Trading Panel (To be reset weekly = 1-6) 1. EA Status : (on/off) 2. Total Trades Taken : 3. Number of Profitable Trades Today : 4. Number of Loosing Trades Today : 5. Number of Profitable Trades This Week : 6. Number of Loosing Trades This Week : (To be Reset every Month = 7-9) 7. Number of Profitable Trades This Month : 8. Number of Loosing
We are seeking an experienced MQL4 developer to create a forecasting indicator with a prediction accuracy above 80%. The indicator must be capable of learning from historical market data starting from the year 2000 to the present. Additionally, it should offer an option to analyze and learn from all available candlesticks on the current timeframe, allowing it to adapt to real-time market conditions. Key Requirements
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk
NRTR - indicator for MetaTrader 5 NRTR (Nick Rypock Trailing Reverse) - indicator for MetaTrader 4 NRTR WATR - indicator for MetaTrader 4 NRTR GATOR - indicator for MetaTrader 5 X2MA NRTR - indicator for MetaTrader 5 NRTR - indicator for MetaTrader 5 NRTR GATOR - indicator for MetaTrader 4 NRTR - indicator for MetaTrader 4 Stalin_NRTR - indicator for MetaTrader 5 NRTR Color Line - indicator for MetaTrader 5 NRTR Rosh
Charlie 40 - 100 USD
Hi. I am looking for a Mentor that has verifiable experience trading forex and commodities. Somebody who has a couple years experience in failures and successes. I am not a beginner. I have modest success already with discretionary trading. I have had an EA created that is very promising. It has extensive testing with very good results. The idea would be to work together advancing the existing EA and build additional
CHAPTER 1: BASICS 1.THE BASICS 1.1. EXPANSION AND RETRACEMENT Expansion =>occurs when there is an impulse movement towards a direction. Retracement => is the correction movement after an impulse movement. 1.2. FIBBONACCI RETRACEMENT USED TO DETERMINE THE END OF THE RETRACTION MOVEMENT, USUALLY THE PRICE RETRACTS TO 50% OR UNTIL OTE (0.62, 0.705, 0.79) BEFORE ANOTHER IMPULSE MOVEMENT OCCURS. 1.3. BMS - BREAK IN MARKET
My requirements are the following. I am ordering, I need an expert consultant on EA matters and an indicator in the trade pairs of XAUUSD and XAGUSD, we also need powerful robots for changing prices in the market. the market conditions, i.e. flexibility, then the business should be beneficial for all I need high and low line python line position to work thank you
QuantumTrader 30 - 200 USD
Request for development of machine learning robots for MetaTrader 5 (MT5) **Description**: Willing to develop experience in programming trading robots using MQL5 language and can learn machine learning on MetaTrader 5 (MT5) platform. The robot should be able to implement a multidisciplinary strategy on a set of technical indicators and multiple rules. I need to develop the robots so that they can work in an

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD
Scadenze
da 1 a 2 giorno(i)