Delete Order After a Number of Bars have Past.

 

Publi

Delete Order After a Number of Bars have Past.

 

Publi

Risultati da 1 a 4 di 4

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

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

    Thanks in advance,

  2. #2
    int BarCount; init() /Place an order if(SignalOpen) { OrderSend() BarCount = Bars; } /Delete the order if(BarCount 5 lt;= Bars) OrderDelete();

  3. #3
    @ RR; I appreciate the quick reply. Hopefully I can help you one day soon.
    Citazione Originariamente Scritto da ;
    int BarCount; init() /Place an order if(SignalOpen) { OrderSend() BarCount = Bars; } /Delete the order if(BarCount 5 lt;= Bars) OrderDelete();
    Citazione Originariamente Scritto da ;
    int BarCount; init() /Place an order if(SignalOpen) { OrderSend() BarCount = Bars; } /Delete the order if(BarCount 5 lt;= Bars) OrderDelete();

  4. #4
    I tried using your code and I think I am doing something wrong because the EA is closing the open trade the next bar open with the following code. Please advise, Inserted Code for(cnt=0;cntlt;total;cnt ) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()lt;=OP_SELLSTOP /check for opened position OrderSymbol()==Symbol()) /check for symbol { if(OrderType()==OP_BUYSTOP) /buystop position is opened { 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); } } } } }
    Citazione Originariamente Scritto da ;
    int BarCount; init() /Place an order if(SignalOpen) { OrderSend() BarCount = Bars; } /Delete the order if(BarCount 5 lt;= Bars) OrderDelete();
    Citazione Originariamente Scritto da ;
    int BarCount; init() /Place an order if(SignalOpen) { OrderSend() BarCount = Bars; } /Delete the order if(BarCount 5 lt;= Bars) OrderDelete();

Permessi di Scrittura

  • Tu non puoi inviare nuove discussioni
  • Tu non puoi inviare risposte
  • Tu non puoi inviare allegati
  • Tu non puoi modificare i tuoi messaggi
  •  
Il sito di forexmad utilizza cookie
Il sito di forexmad utilizza cookie, alcuni dei quali già installati. Per avere maggiori informazioni sui nostri cookie ti preghiamo di cliccare qui. Ti preghiamo di cliccare sul bottone a destra per accettare i nostri cookie. Se continui a navigare sul sito di forexmad assumeremo che sei d'accordo ad utilizzarli.