// Çàêðûòü ïðèáûëüíûå îðäåðà.mq4 // Ñêðèïò #property copyright "mandorr@gmail.com" #property show_inputs extern int Profit=5; void start() { int slippage=2; int ask, bid, open; double point; for (int i=OrdersTotal()-1; i>=0; i--) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderType()==OP_BUY) { point=MarketInfo(OrderSymbol(),MODE_POINT); if (point==0) break; bid=MathRound(MarketInfo(OrderSymbol(),MODE_BID)/point); open=MathRound(OrderOpenPrice()/point); if (bid-open<Profit) continue; OrderClose(OrderTicket(),OrderLots(),bid*point,slippage); } if (OrderType()==OP_SELL) { point=MarketInfo(OrderSymbol(),MODE_POINT); if (point==0) break; ask=MathRound(MarketInfo(OrderSymbol(),MODE_ASK)/point); open=MathRound(OrderOpenPrice()/point); if (open-ask<Profit) continue; OrderClose (OrderTicket(),OrderLots(),ask*point,slippage); } } } // End
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Checks for the total of open orders
It Closes Orders by itself
Other Features: