guys and girls
I am novice programmer and would really appreciate some help. I am trying to close an order if certain conditions are met using the following code
if (orderopen == 1 && OrderType() == OP_BUY && FMA < SMA)
using alerts I notice that OrderType is returning 0 for long and short positions....shouldn't OrderType be 1 if its a short position?
thanks in advance
Are you sure you have read your order before testing the type ?
You must first select the appropriate order using the OrderSelect() function.
Then you may test the type using the OrderType() function in either of the following ways:
if (OrderType() == OP_SELL)
if (OrderType() == 1)
Please enable the necessary setting in your browser, otherwise you will not be able to log in.