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

Multi timeframe indicator passses output value for default session template

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

    Multi timeframe indicator passses output value for default session template

    Hello! After a lot of hours trouble shooting, I belive that I have found an unexpected behaviour when referencing a multi timeframe indicator in a another indicator. The problem seems to be that the output value from the multi timeframe indicator always is calculated for the the default session template of the instrument, eaven when it's attached to a chart of another session template.

    I have created a simple indicator that plots the SMA(20) for the 5, 10 min, 20 min, 60 min timeframes and added the indicator to a 5 min chart. This indicator calculates an output value that is the number of timeframes above the SMA(20) of the base period. The output series can be between 0 and 3. When I reference the output IntSeries in another indicator, the output value is calculated for the default session template of the instrument, although both indicators are attached to a chart with the ETH session template. I can see this for sure when I compare the print statments in the multi timeframe indicator for the same bar that is printed twice, since it also prints when the second indicator calls the first indicator. The output values differ. The multi timeframe indicator is plotted correctly in the ETH time frame. But when the output value is referenced by another indicator, it passes an output value for the RTH instead of the ETH, as expected.

    /regards
    Last edited by poseidon_sthlm; 01-07-2011, 11:14 AM.

    #2
    Hello poseidon_sthlm,

    This is expected with your particular usage. It will use the default session template as defined in the instrument manager.

    It will only use the chart session template if the multiseries indicator is applied to the chart AND you're accessing the values from within that multiseries script. Once you access it from another script is when it will use the instrument manager setting for session template.

    We recently worked through this here:


    This is documented here > Notes in: True Event Driven OnBarUpdate() Method
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the prompt reply, as always It's appreciated.

      I see now that I can achieve the behaviour I would expect by changing the default session template of the instrument. I also tried to add all the timeframes I use in the indicator to the chart, but that didn't make any difference.

      I still feel that the current approach is confusing, although it is documented. I do suggest that one should be able to programmatically set the session template. Maybe as an additional parameter in the Add() method. Please forward this suggestion to your development department.

      /Regards

      Comment


        #4
        Sure thing - I will forward your request to allow session template as input parameter in multiseries scripts.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cls71, Today, 04:45 AM
        0 responses
        1 view
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Working...
        X