I am trying to code a condition that allow the EA to trade once in each candle, and I want to understand the difference between the below 2 codes as when I test them each one take different trades
Thanks
//First version//
---------------------
//second version//
-----------------------------
in this code I moved the Trade = 0 to be after the execution of the trade of OrderSend()
Can someone help me understand the difference in logic between these 2 which led to the execution of different trade?
Thanks
Thanks
//First version//
---------------------
Inserted Code
if(OpenPrice != Open[1]){
Trade = 1;
OpenPrice = Open[1];}
else{Trade = 0;} //second version//
-----------------------------
Inserted Code
if(OpenPrice != Open[1]){
Trade = 1;
OpenPrice = Open[1];} in this code I moved the Trade = 0 to be after the execution of the trade of OrderSend()
Can someone help me understand the difference in logic between these 2 which led to the execution of different trade?
Thanks