İş Gereklilikleri

# 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}")

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(2)
Projeler
2
0%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
2
100%
Serbest
2
Geliştirici 2
Derecelendirme
(42)
Projeler
62
8%
Arabuluculuk
12
58% / 42%
Süresi dolmuş
1
2%
Serbest
3
Geliştirici 3
Derecelendirme
(35)
Projeler
50
42%
Arabuluculuk
3
33% / 33%
Süresi dolmuş
4
8%
Serbest
4
Geliştirici 4
Derecelendirme
(6)
Projeler
10
50%
Arabuluculuk
6
17% / 50%
Süresi dolmuş
3
30%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(5)
Projeler
4
50%
Arabuluculuk
4
0% / 75%
Süresi dolmuş
0
Serbest
Benzer siparişler
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
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
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
The goal is to develop a system that mirrors trade actions (Buy/Sell) from a CTrader demo account on Cronos Markets to multiple prop firm accounts on TradeLocker, ensuring accurate replication of trades while adjusting risk proportionally. I was wondering if you could help me with copy trading an EA’s action on Cronos markets (uses CTrader) into a prop firm account that I bought with TooOne Trader (uses TradeLocker
Need a Coding Expert. Fully automated Robot for Trading with minimal losses. It should be able to open/close trades automatically according to the strategy. Also, there should be an option to select maximum leverage for Trading FOREX, COMMODITIES, ENERGIES, etc. The forecast reports of trading strategies to be shared automatically to a specified Email, WhatsApp and Telegram accounts. TO DEVELOP A TRADING MANAGEMENT

Proje bilgisi

Bütçe
30+ USD
Geliştirici için
27 USD
Son teslim tarihi
from 1 to 2 gün