//+------------------------------------------------------------------+
//|             Copyright © 2010, Konstantin http://www.fxaktiv.com  |
//|                        panelektrik@yandex.ru skype pan--elektrik |
//|                                ISQ 561090193 Моб.+380 50 7115118 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Konstantin http://www.fxaktiv.com  panelektrik@yandex.ru"
#property link      "http://www.fxaktiv.com  panelektrik@yandex.ru  skype pan--elektrik ISQ 561090193"
#property show_inputs

 extern int Bezub = 30;               //Дистанция сработки безубытка
 extern int BezubPlus = 10;           //Уровень профита при безубытке
//+------------------------------------------------------------------+
void modify()
 {
 double bz=Bezub*Point+BezubPlus*Point+MarketInfo(Symbol(),MODE_STOPLEVEL)*Point; 
 for(int i=0;i<OrdersTotal();i++)
 {
 if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
 {
 if((OrderType()==OP_BUY)&&(OrderStopLoss()<OrderOpenPrice())&&(Bid-OrderOpenPrice()>bz)){OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+BezubPlus*Point,OrderTakeProfit(),0);}
 if((OrderType()==OP_SELL)&&(OrderStopLoss()>OrderOpenPrice())&&(OrderOpenPrice()-Ask>bz)){OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-BezubPlus*Point,OrderTakeProfit(),0);}
 }}}
//+------------------------------------------------------------------+
int start()
 {

 modify();
 Sleep(10000);
 
 }
//+------------------------------------------------------------------+