M5- Scalper - Can anyone fix this EA?

 
A scalper that to trade non stop whit TP between 2 and 4 pips. A scalper to work on as many instruments together (recommended instruments:Audjpy, audusd, cadjpy, chfjpy, eurchf, eurgbp, eurjpy, eurusd, gbpchf, gbpjpy, gbpusd, nzdjpy, nzdusd, usdcad, usdchf, usdjpy, gold, oil, dax, dow) Rules for opening: 1. the second candle of the same color(heiken ashi) 2. when the price is above / below the blue line (middle) being Keltner Channel to buy / sell 3. when the price is above / below the moving average ind. buy / sell -runs on M5 timeframe -all indicators. 10 periods(Keltner Channel, moving average,TrendViewer) -SL and TP hidden -TP between 2 and 4 pips -SL Keltner Channel indicator Green Line (adjusted each open position) -Trailing Stop: half of TP(first move of trailing stop is on 00$. avoid so many transactions minus) -after trailing stop is moved to 0, opening another transaction with the same characteristics of the above. -if the transaction is flawed and trend goes back, hedge opens with double volume, with the same rules for SL and TP.
Files:
 

Forum on trading, automated trading systems and testing trading strategies


Welcome,

  • Usually people who can't code don't receive free help on this forum, though it could happen if you are lucky, be patient.
  • If you show your attempts and describe well your problem, you will most probably receive an answer from the community.
  • If you don't want to learn to code, nothing bad, you can either look at the Codebase if something free already exists, or in the Market for paid products (sometimes free also).
  • Finally, you also have the option to hire a programmer in the Freelance section.

Good luck.


 
  1. In the presence of multiple orders (one EA multiple charts, multiple EA's, manual trading)
  2. There is Tick, PIP, and Point. They are all different in general. A tick is the smallest change of price. A Point is the least significant digit quoted. In currencies a pip is defined as 0.0001 (or for JPY 0.01)

    On a 4 digit broker a point (0.0001) = pip (0.0001). [JPY 0.01 == 0.01] On a 5 digit broker a point (0.00001) = 1/10 pip (0.00010/10). Just because you quote an extra digit doesn't change the value of a pip. (0.0001 == 0.00010) EA's must adjust pips to points (for mq4.) In currencies a tick is a point. Price can change by least significant digit (1.23456 -> 1.23457)

    In metals a Tick is still the smallest change but is larger than a point. If price can change from 123.25 to 123.50, you have a TickSize of 0.25 and a point of 0.01. Pip has no meaning.

    This is why you don't use TickValue by itself. Only as a ratio with TickSize. See DeltaValuePerLot()


  3. You are not adjusting SL, TP, and slippage for 4/5 digit brokers.
    double   pip        = StringFind(_Symbol,"JPY") < 0 ? 0.01 : 0.0001;
    int      pip_digits = (int)MathLog10(pip/_Point);
    int      slippage   = 3 * int(pip / _Point);

  4. Your code includes the spread in SL and TP. Fails if the spread is larger than 2 pips (StopLoss=2, closes immediately.)  Does not use server stops, fails when connection is lost.
Reason: