Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry is happening on the wrong candle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Entry is happening on the wrong candle

    Hello,

    I'm having trouble entering on the exact candle where the EMA 9 and EMA 20 cross. It always enters on the following candle. I'm using if (CrossAbove(ema9, ema20, 1).

    Can someone help me getting a better entry rather than waiting for a candle to close to enter.

    Thanks
    Loskee​
    Attached Files

    #2
    That is just how it works - you can only see in the current candle (at the end of it) that the crossover happened, while the command for Entry can only happen in (or at the opening of) the next candle.

    A solution people may offer, is having multiple timeframes in there and use the smaller timeframe for the Entry (have the EMA etc. math on the original larger timeframe).

    Comment


      #3
      Originally posted by loskee View Post
      Hello,

      I'm having trouble entering on the exact candle where the EMA 9 and EMA 20 cross. It always enters on the following candle. I'm using if (CrossAbove(ema9, ema20, 1).

      Can someone help me getting a better entry rather than waiting for a candle to close to enter.

      Thanks
      Loskee​
      Try setting update option to price change or tick by tick.
      RJay
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment


        #4
        This is a trade-off - if you enter intrabar, so that you can get a fill on the same candle as the crossover, what will frequently happen is that it will uncross before the bar closes, leaving you with an incorrect entry. The only truly correct thing to do is to wait for the bar to close, then enter at or as close as is practical to the next bar's open. To think you can consistently enter at the exact close of the same bar that the crossover happens is unrealistic.Some platforms - especially TradeStation in the "old days" - allowed you to pretend that you could do this, and this was a simplifying assumption for analysis, but led to lots of trading systems with a great looking backtest that are completely unable to reproduce it live.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          You can enter at end of bar or intrabar or slightly before the candle closes.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          37 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X