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

Multiple time frame indicator inside a strategy

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

    Multiple time frame indicator inside a strategy

    If I create an indicator that adds 2 specific time frames
    Code:
    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Minute, 5);
    AddDataSeries(BarsPeriodType.Minute, 10
    }
    );
    The indicator only uses those series to calculate its properties, but sets a value on the granularity of the main time series.

    if I want to use this indicator class in a strategy, it doesnt seem to run. The strategy is running on a 5min interval as well.

    I might have messed something else up, but I guess my question is relatively well defined.
    If I use an indicator where I add multiple time frames, can I just use an instance of this indicator in my strategy? Will it work like that or is it more complicated/impossible?

    #2
    Hello crystalet,

    Are you seeing an error when you say that the strategy does not run?

    The strategy also needs to add those two series, after doing so you should be able to call the indicator from OnBarUpdate like other indicators.

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

    Comment


      #3
      I meant to say, I made NT8 crash completely twice in a row with it... was trying to see the log window, but didnt get there as the application shut down.

      I will try adding the series and see if that helps. Might be for Monday as in my timezone its dinner time

      Comment


        #4
        Hello crystalet,

        A complete crash that can be repeated usually points at a problem with the coding. One situation that would happen would be a recursive public property. As I don't know what was coded I don't want to get too ahead and guess here. If the indicator is simple enough you can upload it with a sample of how you used it in the strategy. I would otherwise suggest to try a system indicator in place of yours to confirm the strategy can or cannot use that. If the strategy can use it then the problem is within your indicator.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by greenfastdietusa, Today, 02:10 AM
        0 responses
        5 views
        0 likes
        Last Post greenfastdietusa  
        Started by greenfastdietusa, Today, 02:08 AM
        0 responses
        4 views
        0 likes
        Last Post greenfastdietusa  
        Started by Learner Trader, Today, 01:49 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by alcorr247, Yesterday, 09:53 PM
        1 response
        37 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by traderslab, Yesterday, 10:27 PM
        0 responses
        40 views
        0 likes
        Last Post traderslab  
        Working...
        X