Delete Order After a Number of Bars have Past.
Results 1 to 4 of 4

Thread: Delete Order After a Number of Bars have Past.

  1. #1
    Can someone please assist me with code to delete an open Buy/Sell Stop order that has been opened for any number of bars back.

    Thanks in advance,

  2. #2
    Int BarCount; init() /Place an order if(SignalOpen) OrderSend() BarCount = Bars; /Combine the order if(BarCount 5 lt;= Bars) OrderDelete();

  3. #3
    @ RR; I love the quick reply. I can help you.
    Quote Originally Posted by ;
    int BarCount; init() /Place an order if(SignalOpen) OrderSend() BarCount = Bars; /Combine the order if(BarCount 5 lt;= Bars) OrderDelete();
    Quote Originally Posted by ;
    int BarCount; init() /Place an order if(SignalOpen) OrderSend() BarCount = Bars; /Combine the order if(BarCount 5 lt;= Bars) OrderDelete();

  4. #4
    I tried using your code and I think I am doing something wrong since the trade the next bar open with the next code is being closed by the EA. Please advise, Inserted Code for(cnt=0;cntlt;complete;cnt ) OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()lt;=OP_SELLSTOP /test for opened position OrderSymbol()==Symbol()) /test for symbol if(OrderType()==OP_BUYSTOP) /buystop position is started if(TotalOrdersMode(MagicNumber,OP_SELL) lt;= 0) if(BarCount 5 lt;= Bars) ticket = OrderDelete(OrderTicket(),Green); else/go to sellstop position if(TotalOrdersMode(MagicNumber,OP_BUY) lt;= 0) if(BarCount 5 lt;= Bars) ticket = OrderDelete(OrderTicket(),Red);
    Quote Originally Posted by ;
    int BarCount; init() /Place an order if(SignalOpen) OrderSend() BarCount = Bars; /Combine the order if(BarCount 5 lt;= Bars) OrderDelete();

أذونات النشر

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  
  • رمز BB مفعل
  • الابتسامات مفعلة
  • رمز[IMG] مفعل
  • رمز [VIDEO] مفعل
  • رمز HTML غير مفعل
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.