avatar
BE

MarketBuler 25 4th Sep, 2020

CPP 1.07 KB
                                           
                         extern int BE_Point = 10;
extern int BE_Active_Point = 25;
bool OM;

void OnTick()
  {
  
   CheckSellbetop();  
   CheckBuybetop();      
   
  }


void CheckSellbetop()
{
   for(int be=OrdersTotal()-1;be>=0;be--)
     {
      if(OrderSelect(be,SELECT_BY_POS,MODE_TRADES))
      if(OrderSymbol()==Symbol())
      if(OrderType()==OP_SELL)
      if(OrderStopLoss()>OrderOpenPrice())
      if(Bid<OrderOpenPrice()-BE_Point*_Point)
        {
         OM=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-BE_Active_Point*_Point,OrderTakeProfit(),0,CLR_NONE);
        }
     }
}

void CheckBuybetop()
{
   for(int be=OrdersTotal()-1;be>=0;be--)
     {
      if(OrderSelect(be,SELECT_BY_POS,MODE_TRADES))
      if(OrderSymbol()==Symbol())
      if(OrderType()==OP_BUY)
      if(OrderStopLoss()<OrderOpenPrice())
      if(Ask>OrderOpenPrice()+BE_Point*_Point)
        {
         OM=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+BE_Active_Point*_Point,OrderTakeProfit(),0,CLR_NONE);
        }
     }
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.