Hi All
is there a way using HistoryTotal function to be able to find a particular order (buy or sell) closed ?
I tried with this code but it seems not working :
And when a buy order was in place using OrderSelect I identified this using "LONG" as comment (and "SHORT" if a sell order) :
Maybe function OrderComment is not supported using in conjuction with MODE_HISTORY mode? And if so how can I solve this issue?
thx a lot
Skyline
is there a way using HistoryTotal function to be able to find a particular order (buy or sell) closed ?
I tried with this code but it seems not working :
Inserted Code
int hstTotal=HistoryTotal(); for(i=0; i < hstTotal ; i++) { if (OrderType()==OP_BUY && OrderComment()=="LONG") { ..take some action... } if (OrderType()==OP_SELL && OrderComment()=="SHORT") { ..take some action... } }
And when a buy order was in place using OrderSelect I identified this using "LONG" as comment (and "SHORT" if a sell order) :
Inserted Code
Sell : .. .. OrderSend(Symbol(),OP_SELL,Lots,Entry,Slippage, StopLoss ,TakeProfit,"SHORT",0,0); .. .. Buy : .. .. OrderSend(Symbol(),OP_BUY,Lots,Entry,Slippage, StopLoss ,TakeProfit,"LONG",0,0); .. ..
Maybe function OrderComment is not supported using in conjuction with MODE_HISTORY mode? And if so how can I solve this issue?
thx a lot
Skyline