Not logged in
Viewing 4 posts - 1 through 4 (of 4 total)

Forums>EA Wizard>Make my EA>Closing Order when price didn't move forward after some bars

  • #237151 |
    Conmariin
    Participant
    103 Posts

    Hi,

    I want to close an order after x bars when price is not moving in my direction for example when a trend reversal occurs. How can I achieve it in an EA? Is that possible? Any Ideas?

    Thanks ūüôā

     

     

    #237152
    Conmariin
    Participant
    103 Posts

    I forgot I know how to close after x bars. I want to know how to Code that the ea is realizing that its not going anymore in the opened direction.

    #237157
    Customer
    41 Posts

    Hi,

    First of all, for me, that is what an SL is for. if you base it on ATR, that could give your EA a good idea that you’re wrong with your assumption and the need to exit a trade is present.

    But if you want a specific exit rule that contains “IF x bars has passed after order opened AND¬†Another-Condition THEN¬†close order¬†” that would depend on the trading strategy you are trying to code, and what would be an indication of “going the wrong way” or a “reversal” for you.

    For example, maybe you want to use Fibonacci levels (38.2%, 50.0% and 61.8% ) to determine a bar closed beyond/above them which means reversal probability for you? Maybe pivot points is best for that assumption? maybe candlestick patterns? (Though IMO they’re useless).

    So have your strategy in mind, and you can code it..

    Ilya

     

     

    #237177
    tomas262
    Administrator
    853 Posts

    As Ilya mentioned the simplest solution is usually the best Рmeaning use a simple stop-loss

    Another option would be to combine Open P/L < 0 & Bars Since Order Open > X => close a position

    Let me know if you need any help with the setup

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.