Can anyone fix this EA? Thanking in advance.

 

it buys when price closes above 20 EMA and sells on the opposite.

but when I close the buy intentionally............. it creates another buy order.

What i need is.......

when it will be attached into a chart..... it will start only when opposite signal is available. For instance, if I open my terminal and price is above the 20EMA (buying condition).... the EA will open a Sell position when price closes below the EMA20 line.

and

when I take profit manually........... it will not open further buy or sell position.

thanking in advance.

Files:
 
Ahmad Chowdhury:

it buys when price closes above 20 EMA and sells on the opposite.

but when I close the buy intentionally............. it creates another buy order.

What i need is.......

when it will be attached into a chart..... it will start only when opposite signal is available. For instance, if I open my terminal and price is above the 20EMA (buying condition).... the EA will open a Sell position when price closes below the EMA20 line.

and

when I take profit manually........... it will not open further buy or sell position.

thanking in advance.

Try Freelance if no one helps you here in the forum ;)

 
  1. Ahmad Chowdhury: but when I close the buy intentionally............. it creates another buy order.
    bool buy_condition_1 = iMA(NULL, PERIOD_M5, 20, 0, MODE_EMA, PRICE_CLOSE, 0)  < Low[1]   ;
    bool buy_condition_2 = Close[1]  > Open[1]  ;
    if( buy_condition_1  &&  buy_condition_2   )
    You are looking at a signal. Act on a change of signal.
              MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum

  2. #property copyright "fxeabuilder.com"
    EA builder, EATree, Forex Strategy Builder, FX EA Builder, fxDreema, FxPro, Molanis, Online Forex Expert AdvisorGenerator, Quant, Strategy Builder FX, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
    • Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
      If we tell you what you need, you can't code it.
      If we give you the code, you don't know how to integrate it into yours.
      We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

    • EA builder makes bad code counting up while closing multiple orders.
      EA builder makes bad code Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
                New candle - MQL4 forum
      EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
      EA builder makes bad code, not adjusting for ECN brokers. (pre-Build 500)
      EA builder makes bad code, not checking return codes.
      EATree uses objects on chart to save values - not persistent storage ( files or GV+Flush.) No recovery (crash/power failure.)

    • FX EA Builder makes bad code, not checking return codes.
      FX EA Builder makes bad code, loosing open tickets on terminal restart.
      FX EA Builder makes bad code, not adjusting stops for the spread.
      FX EA Builder makes bad code, using OrdersTotal directly.
    Learn to code it, or pay someone (Freelance) someone to code it.

Reason: