Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to trigger/simulate second series update during backtest?

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

    How to trigger/simulate second series update during backtest?

    Hello guys,

    I'm attaching simplified screenshot(from backtest) of what I'm trying to do and here is some context:

    - I have strategy (Calculate.OnEachTick) which is using 2 data series, 60Min(MAIN) and 1Day(SECOND). I want to have updates for second time series inside the day (for current day).
    - It works as expected in LIVE but not in Backtest.
    - Not sure if this helps, but you might ask why do I need this. So this is needed because I want to use indicator attached to BarsArray[1] and be updated during the day while day bar is building. I try to trigger Update for indicator, but this did not help, because BarsArray[1] still not updated.

    So my question if it is possible to trigger 1Day series update on 60Min series like it was a tick for 1Day series? Something similar how you guys doing Update for indicator cache from another series.
    Attached Files
    Last edited by login_dejavu; 03-31-2020, 02:34 AM.

    #2
    Hello login_dejavu,

    One factor here is that you mentioned you use OnEachTick which is not specifically going to be available in back testing. You can use TickReplay to drive the series based on tick replay data/logic but a backtest in general uses OnBarClose processing and only has the OHLC of each bar. In your image I believe what you are highlighting is the constant value of the day bar, that would be expected because the primary is less granular and the day bar has not closed in that span of time to cause a change. If you use TickReplay you would instead set the series of events as the price updates however that would require other logic to determine when your bars close, mainly using the IsFirstTickOfBar property.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, 04-16-2024, 06:09 PM
    4 responses
    12 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    8 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    6 views
    0 likes
    Last Post nandhumca  
    Started by The_Sec, Today, 03:37 PM
    0 responses
    3 views
    0 likes
    Last Post The_Sec
    by The_Sec
     
    Started by GwFutures1988, Today, 02:48 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X