I have 3 variables of global scope. Long, Short, Out. These are defined as bool.
My question is: everytime Start runs does it re-initialize values for global variables?
I am trying to keep track of my current position. But Even though they should have a value the check I am doing is showing them all a 0(false)
My question is: everytime Start runs does it re-initialize values for global variables?
I am trying to keep track of my current position. But Even though they should have a value the check I am doing is showing them all a 0(false)
Inserted Code
if (isSellSignal()) { if (Out==true)Short=GoShort(Lots); Print("Currently Out. Sell Signal Received. Going Short."); if (Long==true) Out=CloseOrder(); Print("Currently Long. Sell Signal Received. Position Closed."); } if (isBuySignal()) { if (Out==true) Long=GoLong(Lots); Print("Currently Out. Buy Signal Received. Going Long."); if (Short==true) Out=CloseOrder(); Print("Currently Short. Buy Signal Received. Position Closed."); } if (!Out) { if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)) TrailOrder(OrderType()); }