Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry at higher/lower than previous candle

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

    #16
    Hello Jim H.,

    Thank you for your reply.

    It's important to keep in mind that in a backtest, fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

    Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick'.

    Also, here is a link to the differences on real-time vs backtest (historical).
    http://ninjatrader.com/support/helpG...ime_vs_bac.htm

    So if you're running the strategy on each tick on live data, any positions calculated in a backtest or on historical data on a chart will actually be calculated as if you were running the strategy On Bar Close instead of On Each Tick. That may be the source of the strategy appearing to not calculate as you'd expect if you're not actually looking at what it's doing when running it on live data.

    You can set up a crossover condition to check the previous bar and the one prior to it if you like, just set the bars ago for both the MACDs to 1:

    Click image for larger version

Name:	2021-02-09_08-50-14.png
Views:	289
Size:	48.3 KB
ID:	1140842

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    78 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X