EugeneCT: Would appreciate some enlightenment.
-
static int NumberOfBuyPositions=0,NumberOfSellPositions=0; ⋮ static double Lower_High=0; /// Most Recent Lower High Value(Close of Bullish Candle) static double Lower_High2=0; /// High2=High, High=New High (2nd most recent)
Do you realize that all global variables are static? -
double Close[]; ⋮ ArrayResize(Close,Candle_Nos); ⋮ double High_10=Close[High_10_Index-1]; /// Obtain Hisghest Close of Last 10 Close
What values to you think your array has?
Ok, apparently the Array[0] and Array[1] value is not updated.
Problem Solved after declaring all the OHLC Arrays in static. Its odd that the codes works in default MT5 Terminal at the first place.
Many thanks William and have a good day!
Problem Solved after declaring all the OHLC Arrays in static. Its odd that the codes works in default MT5 Terminal at the first place.
Many thanks William and have a good day!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear All, would need some advice for my codes as im trying to write an EA for Executing a Buy order whenever the previous Lower High is broken and vice-versa for Sell Order.
The code works and orders are executed as expected in default MT5 terminal.
However the issue is when i started to backtest at broker terminal it seems to not executing the Buy or Sell order although the Sell Function/Buy Function is called.
Somehow weird as similar code(CExpert.Buy) with different strategy had been tested with same broker and it works.
Would appreciate some enlightenment. My code is as attached.