| / | Forum |
|
shadow
2006.09.13 17:03
nead help: i want to evaluate the profit results (if have 5 losses in row want to
excicute order to stop trade)
have any advice please |
|
Terminal Service Client. How to Make Pocket PC a Big Brother's Friend The article describes the way of connecting to the remote PC with installed MT4 Client Terminal via a PDA. |
|
riyo
2006.09.15 05:31
int losses = 0; for(int i=HistoryTotal()-1;i>=0;i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; } if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue; if(OrderProfit()>0 || losses>=5 ) break; if(OrderProfit()<0) losses++; } if (losses >= 5) { // CLOSE ALL ORDERS HERE ... } |