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

Impossible to backtest when using daily pivots?

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

    Impossible to backtest when using daily pivots?

    I'm working on a strategy that uses the pivots indicator. I came across the following in the help section for the indicator

    Tips
    1. When using HLCCalculationMode.DailyBars it can be expected that a value of 0 is returned when the daily bars have not been loaded yet. Due to the asynchronous nature of this indicator calling daily bars you should only access the pivot values when the indicator has loaded all required Bars objects. To ensure you are accessing accurate values you can use .ContainsValue() as a check:

    This seems to work just fine when running the system in real time. However there is no way for me to backtest on historical data since I cannot find a way to force these daily bars to be loaded.

    I just want to make sure I'm not missing something before I write my own pivot indicator

    #2
    shazzmoe,

    You could try to use a multi-series indicator here, i.e. add the daily bars as a secondary time frame to your strategy.



    There is a sample that comes with NinjaTrader in Tools > Edit NinjaScript > Indicator > SampleMultiTimeframe.

    I am not exactly sure that will work with Pivots here but I have had success when I needed tick data for various calculations and was running on minute-based charts.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Unfortunately I've already tried this and it doesn't make a difference. I appreciate the quick response. It's probably best I design a custom indicator for my task anyways.

      Comment


        #4
        shazzmoe,

        I had a feeling that may happen as I don't think the indicator inherits all the series. The indicator itself may need to have this series added so making a custom indicator is probably your best bet here.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by llanqui, Today, 11:10 AM
        0 responses
        4 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by llanqui, Today, 10:29 AM
        0 responses
        5 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by llanqui, Today, 08:32 AM
        1 response
        12 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by lollers, Yesterday, 03:26 AM
        1 response
        53 views
        0 likes
        Last Post lollers
        by lollers
         
        Started by Salahinho99, 05-05-2024, 04:13 AM
        7 responses
        63 views
        0 likes
        Last Post Salahinho99  
        Working...
        X