Fix an EA that isn't performing in the Strategy Tester

İş tamamlandı

Tamamlanma süresi: 3 gün
Geliştirici tarafından geri bildirim
Good description of requirements specifications. Fast communication. Looking forward to working with you again

İş Gereklilikleri

The specifications:

This EA uses the RSI exclusively for trade opens and closes.  The RSI crosses 50 moving upward and alerts the EA to watch.  When it reaches 53 it triggers a buy order.  When the RSI reaches 70, it triggers a close order.  Conversely, when the RSI crosses 50 moving downward, it alerts the EA.  When it reaches 47 it triggers a sell order.  This order is closed at RSI 30.  There is also a contingency if the RSI crosses over the 50 moving the opposite direction that the trade would close.  

As much is in the existing code.

Currently, the EA will only open and close one trade in the Strategy Tester.  I would like you to modify the EA to operate according to these specifications.  

I would also like you to add a trailing stop that can be adjusted.


Here is the existing code:



// Global Variables

enum StateType {WATCHING, LONG_ENTRY, SHORT_ENTRY, CLOSE_TRADE};

StateType state = WATCHING;

double LotSize = 0.1;  // Lot size

double StopLoss = 20.0 * Point;  // Stop loss in price difference

double TakeProfit = 100.0 * Point;  // Take profit in price difference

int slippage = 3;

int RSI_Period = 14;


// OnTick function

void OnTick() {

    double currentRSI = iRSI(Symbol(), 0, RSI_Period, PRICE_CLOSE, 0);

    double previousRSI = iRSI(Symbol(), 0, RSI_Period, PRICE_CLOSE, 1);


    if (state == WATCHING) {

        if (currentRSI > 50 && previousRSI <= 50) {

            state = LONG_ENTRY;

        } else if (currentRSI < 50 && previousRSI >= 50) {

            state = SHORT_ENTRY;

        }

    }


    if (state == LONG_ENTRY && currentRSI >= 53) {

        PlaceLongOrder();

    } else if (state == SHORT_ENTRY && currentRSI <= 47) {

        PlaceShortOrder();

    }


    if (state == CLOSE_TRADE) {

        CloseTrade(currentRSI);

    }

}


// Function to place a long order

void PlaceLongOrder() {

    if (OrdersTotal() == 0) {

        double price = Ask;

        int ticket = OrderSend(Symbol(), OP_BUY, LotSize, price, slippage, price - StopLoss, price + TakeProfit, "Buy Order", 0, 0, clrGreen);

        if (ticket > 0) state = CLOSE_TRADE;

    }

}


// Function to place a short order

void PlaceShortOrder() {

    if (OrdersTotal() == 0) {

        double price = Bid;

        int ticket = OrderSend(Symbol(), OP_SELL, LotSize, price, slippage, price + StopLoss, price - TakeProfit, "Sell Order", 0, 0, clrRed);

        if (ticket > 0) state = CLOSE_TRADE;

    }

}


// Function to close the trade based on RSI

void CloseTrade(double currentRSI) {

    for (int i = 0; i < OrdersTotal(); i++) {

        if (OrderSelect(i, SELECT_BY_POS) && OrderSymbol() == Symbol()) {

            if ((OrderType() == OP_BUY && currentRSI >= 70) || (OrderType() == OP_SELL && currentRSI <= 30)) {

                bool closed = OrderClose(OrderTicket(), OrderLots(), (OrderType() == OP_BUY ? Bid : Ask), 3, clrRed);

                if (closed) state = WATCHING;

            } else if ((OrderType() == OP_BUY && currentRSI < 50) || (OrderType() == OP_SELL && currentRSI > 50)) {

                closed = OrderClose(OrderTicket(), OrderLots(), (OrderType() == OP_BUY ? Bid : Ask), 3, clrRed);

                if (closed) state = WATCHING;

            }

        }

    }

}

    



Yanıtlandı

1
Geliştirici 1
Derecelendirme
(250)
Projeler
313
28%
Arabuluculuk
34
26% / 62%
Süresi dolmuş
10
3%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(37)
Projeler
59
27%
Arabuluculuk
26
19% / 54%
Süresi dolmuş
10
17%
Çalışıyor
Yayınlandı: 1 kod
3
Geliştirici 3
Derecelendirme
(2642)
Projeler
3357
68%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
342
10%
Serbest
Yayınlandı: 1 kod
4
Geliştirici 4
Derecelendirme
(16)
Projeler
35
23%
Arabuluculuk
4
0% / 50%
Süresi dolmuş
2
6%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(14)
Projeler
18
67%
Arabuluculuk
2
50% / 50%
Süresi dolmuş
3
17%
Serbest
6
Geliştirici 6
Derecelendirme
(2309)
Projeler
2905
63%
Arabuluculuk
122
44% / 25%
Süresi dolmuş
429
15%
Çalışıyor
7
Geliştirici 7
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
8
Geliştirici 8
Derecelendirme
Projeler
0
0%
Arabuluculuk
2
0% / 100%
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(43)
Projeler
66
12%
Arabuluculuk
12
58% / 42%
Süresi dolmuş
1
2%
Serbest
10
Geliştirici 10
Derecelendirme
(48)
Projeler
49
8%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Benzer siparişler
I am looking for a professional MQL5 developer to build a MetaTrader 5 Expert Advisor from scratch. The EA will be called LadyKiller EA. It must trade only the following instruments: • XAUUSD (Gold) • US30 / Dow Jones Index Requirements: • Strong and reliable buy and sell entry logic • Stop Loss and Take Profit system • Risk management (lot size control) • Maximum trades protection • Drawdown protection • Trend
I need an mql5 EA which can be used with 100$ capital very low drawdown The EA should be high frequency trading special for XAUUSD and btcusd or binary options but also the EA should be testable via strategy tester and demo test for five days is needed NO SELECTION CAN BE DONE WITHOUT TESTING when applying make sure you send the backtester results with demo EA testable via strategy tester
I currently have a powerful and well-structured Expert Advisor available on the MT5 platform. This EA is designed with: ✅ Advanced entry and exit logic ✅ Smart risk management system ✅ Automatic lot sizing option ✅ Break-even and trailing stop protection ✅ Spread and session filters ✅ Drawdown control features ✅ Optimized for XAUUSD and scalping strategies ✅ Suitable for prop firm challenges like FTMO It is built for
Do you need a profitable and well-structured trading strategy converted into a fully automated Expert Advisor on the MT5 platform? I specialize in developing advanced, high-performance EAs with: ✅ Smart entry & exit logic ✅ Risk-based lot size calculation ✅ Break-even & trailing stop system ✅ Spread & session filters ✅ Daily drawdown protection ✅ Prop firm (FTMO-style) risk compliance ✅ Fully automated trade
Hello, I'm looking to find out the cost of creating a mobile trading robot. I've tried to describe it as thoroughly as possible in the following document. I look forward to your response. I'd like to know the costs, delivery time, and how you plan to implement it before making a decision
I have an existing MT5 Expert Advisor (“E-Core”). I need an experienced MQL5 developer to integrate a structured risk management upgrade and a higher timeframe trend filter into the current code. Two files will be provided: 1️⃣ E-Core Source Code (Current Version) 2️⃣ Update Instructions File (contains exact inputs, functions, and logic to integrate) The developer must: Integrate the update logic
DO NOT RESPOND TO WORK WITH ANY AI. ( I CAN ALSO DO THAT ) NEED REAL DEVELOPING SKILL Hedge Add-On Rules for Existing EA Core Idea SL becomes hypothetical (virtual) for the initial basket and for the hedge basket . When price hits the virtual SL level , EA does not close the losing trades. Instead, EA opens one hedge basket in the opposite direction. Original basket direction Hedge basket direction (opposite) Inputs
Billionflow 30 - 100 USD
Trading specifications: Indicators: Bollinger band ( Period 40, Deviation 1 apply to close) Moving Average (Exponential ) Period 17 applied to high Moving Average ( Exponential ) Period 17 applied to low But Signal enter a buy trade when prices crosses the lower band of the bollinger band up and also crosses the moving average channel of high and low the reverse is true for sell signal
Hello, I am a user of the "BUY STOP SELL STOP V6" trading bot, which is an advanced Grid System bot. The bot is primarily designed for Gold (XAUUSD), but I want it to work on all currency pairs. "The bot contains a privacy/protection code that prevents it from running on other accounts or being modified on any platform, as it has a client account number lock mechanism" --- Bot Description & Current Settings Bot Type
I am looking for a highly experienced Pine Script v5 developer to build a professional, non repaint price action indicator for TradingView. or a ready made one so i can purchase. This is a structured two phase project. The goal is to create a clean, intelligent price action tool that works for both fast intraday trading and swing trading. Only apply if you have strong Pine experience and understand liquidity

Proje bilgisi

Bütçe
50+ USD
Son teslim tarihi
from 1 to 5 gün