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

Trabalho concluído

Tempo de execução 3 dias
Comentário do desenvolvedor
Good description of requirements specifications. Fast communication. Looking forward to working with you again

Termos de Referência

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;

            }

        }

    }

}

    



Respondido

1
Desenvolvedor 1
Classificação
(250)
Projetos
313
28%
Arbitragem
34
26% / 62%
Expirado
10
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(37)
Projetos
59
27%
Arbitragem
26
19% / 54%
Expirado
10
17%
Trabalhando
Publicou: 1 código
3
Desenvolvedor 3
Classificação
(2642)
Projetos
3357
68%
Arbitragem
77
48% / 14%
Expirado
342
10%
Livre
Publicou: 1 código
4
Desenvolvedor 4
Classificação
(16)
Projetos
35
23%
Arbitragem
4
0% / 50%
Expirado
2
6%
Trabalhando
5
Desenvolvedor 5
Classificação
(14)
Projetos
18
67%
Arbitragem
2
50% / 50%
Expirado
3
17%
Livre
6
Desenvolvedor 6
Classificação
(2309)
Projetos
2906
63%
Arbitragem
122
44% / 25%
Expirado
429
15%
Livre
7
Desenvolvedor 7
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
2
0% / 100%
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
(43)
Projetos
66
12%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
10
Desenvolvedor 10
Classificação
(48)
Projetos
49
8%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
2 FX pairs M15 execution with higher timeframe bias Session-based trading (UK time) Fixed % risk per trade Controlled pyramiding (add to winners only) Strict daily loss limits (FTMO-style) Proper order handling (SL always set) Basic logging (CSV) Strategy logic will be provided in detail after NDA / agreement. Must deliver: Source code (.mq5) Compiled file (.ex5) Clean, well-commented code Short support window for
Hi, are you able to create a script/indicator on tradingview that displays a chart screener and it allows me to input multiple tickers on the rows. then the colums with be like "premarket high, premarket low, previous day high, previous day low" . When each or both of the levels break, there will pop up a circle on the chart screener, signaling to me what names are above both PM high and previous day high or maybe
I need an Expert Advisor for MetaTrader 5 (MQL5) to trade XAUUSD based on a simple price movement cycle. Strategy logic: • The EA opens a Buy and a Sell at the same time (one pair per cycle). • Only ONE Sell position must exist at any time. • Every Buy must be opened together with a Sell. Cycle rules: • Step movement = 10 USD in gold price. • CycleEntryPrice = the OPEN PRICE of the last cycle BUY order. • If price
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

Informações sobre o projeto

Orçamento
50+ USD
Prazo
de 1 para 5 dias