Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. extern double BE_T_1 = 50;
  2. extern double BE_M_1 = 5;
  3.  
  4. extern double BE_T_2 = 100;
  5. extern double BE_M_2 = 50;
  6.  
  7. extern double BE_T_3 = 150;
  8. extern double BE_M_3 = 100;
  9.  
  10. double BE_S_M;
  11. double BE_S_T;
  12.  
  13. void MOVE_BE_1()
  14.  
  15. {
  16. for(int b=OrdersTotal()-1;b>=0;b--)
  17. {
  18.  
  19. if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
  20. if(OrderMagicNumber()!=M_Number)continue;
  21. if(OrderSymbol()==Symbol())
  22. if(OrderType()==OP_BUY)
  23. if(Bid-OrderOpenPrice()>BE_S_T*Pips)
  24. if(OrderOpenPrice()>OrderStopLoss())
  25. if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+(BE_S_M*Pips),OrderTakeProfit(),0,CLR_NONE))
  26. Print("eror");
  27. }
  28.  
  29. for(int s=OrdersTotal()-1;s>=0;s--)
  30. {
  31. if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
  32. if(OrderMagicNumber()!=M_Number)continue;
  33. if(OrderSymbol()==Symbol())
  34. if(OrderType()==OP_SELL)
  35. if(OrderOpenPrice()-Ask>BE_S_T*Pips)
  36. if(OrderOpenPrice()<OrderStopLoss())
  37. if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-(BE_S_M*Pips),OrderTakeProfit(),0,CLR_NONE))
  38. Print("eror");
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement