A hedging EA for breakouts

MQL4 Experts

Termos de Referência

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545; min-height: 14.0px} li.li1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545} ol.ol1 {list-style-type: decimal} ul.ul1 {list-style-type: hyphen}

A hedging EA that works on any time frame and any pair


Inputs:

One trade at a time

One trade per day: toggle yes/no

Fixed lot - standard 0.1

Max spread - standard 5

Gap (pip difference between buy and sell orders): standard 10 pips

TP: standard 20 pips

SL: standard 30 pips


Strategy:

Setup:

    - Open a buy_stop_order_1 at price + “Gap/2” pips

    - Open a sell_stop_order_1 at price - “Gap/2” pips 


    First move:  

      - If buy_stop_order_1 is executed, cancel sell_stop-order_1, and open sell_stop_order_2 at same price with lot size x2

      - If sell_stop_order_1 is executed, cancel buy_stop_order_1, and open buy_stop_order_2 at same price with lot size x2

      - If any order hits TP directly, cancel other pending order.


      Here, if the buy order is executed and price goes up to TP, all good. If price comes down, we have a new sell stop order with added lot size to cover the buy order. Same idea if the sell stop order activates first and price doesn’t hit TP.


      Next moves, while TP is not hit in any direction and price floats inside SLs range:

      - If buy_stop_order_2 is executed, cancel sell_stop-order_2, and open sell_stop_order_3 at same price with lot size x2
      - If sell_stop_order_2 is executed, cancel buy_stop_order_2, and open buy_stop_order_3 at same price with lot size x2



      Example:


      Price is 1.0050

      - Set BSO_1 at 1.0055, Lot 0.1, TP 1.075, SL 1.025
      - Set SSO_1 at 1.0045, Lot 0.1, TP 1.025, SL 1.075


        If Price moves up and executes BSO_1:

        - Cancel SSO_1
        - Set SSO_2 at 1.0045, Lot 0.2, TP 1.025, SL 1.075


        Now, price can either:

        (1) hit TP:

        - Cancel pending SSO_2

          (2) or execute SSO_2:

          - Set BSO_2 at 1.0055, Lot 0.2, TP 1.075, SL 1.025


            Now, again, price can either:

            (1) hit TP:

            - Cancel pending BSO_2

              (2) or execute BSO_2:

              - Set SSO_3 at 1.0055, Lot 0.2, TP 1.075, SL 1.025


                Strategy repeats until price hits TP, with lot size increasing for the opposite pending order by 2 lot sizes every time. In this case, if price goes down and hit SSO_3, it would trigger a new BSO_3:

                - Set BSO_3 at at 1.0055, Lot 0.2, TP 1.075, SL 1.025


                  The direction of the last executed order always carries 1 lot size more than the opposite direction. If the trade changes direction, the pending order keeps the same balance over and over until TP hits.


                  Respondido

                  1
                  Desenvolvedor 1
                  Classificação
                  (27)
                  Projetos
                  27
                  26%
                  Arbitragem
                  0
                  Expirado
                  0
                  Livre
                  2
                  Desenvolvedor 2
                  Classificação
                  (77)
                  Projetos
                  239
                  73%
                  Arbitragem
                  7
                  100% / 0%
                  Expirado
                  1
                  0%
                  Livre
                  3
                  Desenvolvedor 3
                  Classificação
                  (615)
                  Projetos
                  1425
                  59%
                  Arbitragem
                  31
                  81% / 0%
                  Expirado
                  10
                  1%
                  Livre
                  4
                  Desenvolvedor 4
                  Classificação
                  (17)
                  Projetos
                  17
                  18%
                  Arbitragem
                  5
                  20% / 60%
                  Expirado
                  2
                  12%
                  Trabalhando
                  Pedidos semelhantes
                  Pazuzu 30+ USD
                  generate or create me a python coded file that has mql5 language requirements for a trading bot under the following instructions. the bot must execute trades if necessary the bot must trade 24/7 the bot must trade gold and currency the bot must make unlimited profit hourly the bot must enter market with caution after market analysis of 98 percent of clear trade
                  Hi, I am looking for someone who has already developed a high-performance Gold EA that can outperform the one shown in my screenshot. If you have such an EA, please apply for this job. Please describe how the EA works (for example, whether it uses a grid system) and provide backtest results along with the set files. If the EA meets my expectations, you can make the necessary adjustments and I will use it as my own
                  CORE STRATEGY LOGIC (THIS IS WHAT MAKES MONEY IN 2025) Primary chart: Renko, 12-tick bricks (fixed, no user change) Instrument: XAUUSD or GC (auto-detect) Minimum tick size: 0.10 (standard Gold) MANDATORY FILTERS – ALL MUST BE TRUE OR NO TRADE 60-minute Trend Filter SMA(100) on 60-minute chart Longs only when current price > SMA100 (60-min) Check the attach file for full project details
                  Copytrade 30+ USD
                  Preciso de um copymaster para b3 onde tenho controle da escrava com números de contratos risco diário etc Controle de mensalidade , escrava onde pode utilizar de qualquer localidade e onde eu tenha controle
                  I have a bot that opens positions based on the opening candle of the New York and London markets. After an MT5 update, the bot stopped working. Does anyone know how to fix it
                  Request: I need a non-repainting MT5 indicator for the M5 timeframe that plots clear buy and sell arrows for Weltrade indices (similar to Boom and Crash on Deriv). Signals must be live and generated at the open of the M5 candle: a sell arrow at candle open must indicate a full 5-minute sell without spikes, and a buy arrow at candle open must indicate a full 5-minute buy without spikes. Note: I already started this
                  I’m developing a trading strategy on Polymarket (15‑minute prediction markets) and I’m looking for a developer who can help with backtesting and then implementing a bot. The strategy is fully rule‑based: • observes 4 crypto markets (BTC, ETH, SOL, XRP) • detects when 3 are in an “extreme zone” and 1 is lagging • enters in the expected direction of the laggard and exits when the gap closes I already have: • a formal
                  The Gorilla 30 - 200 USD
                  Hi, Mr the Gorilla I would like to make an order that might help us both but mostly me , I would like to order a robot to help me trade
                  Hello, i'm looking for a developer who can make an EA for MT5 based on 2 indicators from tradingview. Instrument: XAU/USD 1M timeframe Entry: Based on 2 indicators on tradingview Tp: i want to choose Sl: i want to choose Lotsize: i want to choose Days: i want to choose what day active
                  Hello, I need someone who can covert SuperTrend Strategy indicators on TradingView to an expert advisor with the Stop Loss and Take Profit . The trade shall close on opposite direction based on reversal . And have some features just like below . ART Length and Factor : We can customize the ART Length and Factor just like on TradingView for adaptable trade . Buy Entry: Open long trade right after the bar close (

                  Informações sobre o projeto

                  Orçamento
                  30 - 50 USD
                  Prazo
                  de 2 para 10 dias