Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern double BE_T_1 = 50;
- extern double BE_M_1 = 5;
- extern double BE_T_2 = 100;
- extern double BE_M_2 = 50;
- extern double BE_T_3 = 150;
- extern double BE_M_3 = 100;
- double BE_S_M;
- double BE_S_T;
- void MOVE_BE_1()
- {
- for(int b=OrdersTotal()-1;b>=0;b--)
- {
- if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
- if(OrderMagicNumber()!=M_Number)continue;
- if(OrderSymbol()==Symbol())
- if(OrderType()==OP_BUY)
- if(Bid-OrderOpenPrice()>BE_S_T*Pips)
- if(OrderOpenPrice()>OrderStopLoss())
- if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+(BE_S_M*Pips),OrderTakeProfit(),0,CLR_NONE))
- Print("eror");
- }
- for(int s=OrdersTotal()-1;s>=0;s--)
- {
- if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
- if(OrderMagicNumber()!=M_Number)continue;
- if(OrderSymbol()==Symbol())
- if(OrderType()==OP_SELL)
- if(OrderOpenPrice()-Ask>BE_S_T*Pips)
- if(OrderOpenPrice()<OrderStopLoss())
- if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-(BE_S_M*Pips),OrderTakeProfit(),0,CLR_NONE))
- Print("eror");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement