try this: bool Buy_Condition1 = ( (p_close > hand1[1]) && (p_close - hand1[1] > 20*_Point) );
luenbo:
try this: bool Buy_Condition1 = ( (p_close > hand1[1]) && (p_close - hand1[1] > 20*_Point) );
thanks for replying luenbo,
In my code i am using this exact bracket and semi colon placement as you have shown, the syntax in my code is all correct because i do not have any error or warning in compilation, i missed them posting in my message, sorry about that.
But the problem is that (p_close-hand1[1]>20*_Point) part is not showing in the working of this code. Any suggestion about it will be most welcome.
thanks again luenbo.

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
Hello,
I am coding a condition for buy like this:- bool Buy_Condition1 = (p_close > hand1[1]) && (p_close - hand1[1] > 20*_Point)
But upon backtesting, position gets opened with (p_close > hand1[1]) even if the second condition has not been true yet.
I want there to be a distance of atleast 20pips between my indicator handle value and bar close price. Can anyone point mistake in my code condition please?