Lesson 9 Buy sell stop Order – EA MetaTrader 5
I. Main function 1. Using condition buy or sell base on price action. 2. Auto caculate lot size 3. Auto trailling stop by ATR. 4. Backtest result II. Main tick function //+——————————————————————+ //| Expert tick function | //+——————————————————————+ void OnTick() { if(OpenBar(Symbol())) { OrderManaging(); // Candle declaration double High[],Low[],open[],close[]; ArraySetAsSeries(High,true);ArraySetAsSeries(Low,true);ArraySetAsSeries(close,true);ArraySetAsSeries(open,true); CopyHigh(Symbol(),timeframe,0,1000,High); CopyLow(Symbol(),timeframe,0,1000,Low); … Read more