suggestions with close orders with profit and trailing stop New comment sergio daniel mazza 2014.01.09 01:16 hello I need the suggestions of you, I have this portion of code where I close orders if I gain, besides that let profits run with a difference of 10 percent. I do this because my broker has long takeprofit and I want to close faster. this extern double MinProfit=1.30; extern double TrailingStop=10; double NewProfit; double BottomProfit; void closeOrders(){ for( int i = OrdersTotal() -1; i >= 0 ; i -- ) { if( OrderSelect( i, SELECT_BY_POS, MODE_TRADES ) == false ) break; if( OrderSymbol() == Symbol() ){ RefreshRates(); if(( OrderProfit() >= MinProfit)){ if(( OrderProfit() >= NewProfit)){ NewProfit=OrderProfit(); BottomProfit=OrderProfit()-(OrderProfit()*TrailingStop/100); break; }else{ if(( OrderProfit() <= BottomProfit) && (OrderProfit() >= MinProfit)){ if( OrderType() == OP_BUY ){ Alert("OP: "+ OrderProfit()+" BP: "+BottomProfit+" MP: "+ MinProfit+" NP: "+NewProfit); PlaySound(SoundFileClosed); if (!OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), 0,White )) { logError("closeOrders()", "Error closing BUY order TicketNumber: "+OrderTicket()); } } if( OrderType() == OP_SELL ){ Alert("OP: "+ OrderProfit()+" BP: "+BottomProfit+" MP: "+ MinProfit+" NP: "+NewProfit); PlaySound(SoundFileClosed); if (!OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), 0,Blue )) { logError("closeOrders()", "Error closing SELL orderTicketNumber: "+OrderTicket()); } } } } } } } } module seems good as done? Firebird EA Stop Reverse System 100 pips/day - Expert Needed Swiss Army EA (Automatic order management) New comment
hello I need the suggestions of you, I have this portion of code where I close orders if I gain, besides that let profits run with a difference of 10 percent. I do this because my broker has long takeprofit and I want to close faster.
this
module seems good as done?