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)
    {[INDENT]AddDataSeries(BarsPeriodType.Minute, 5);    [/INDENT][INDENT]AddDataSeries(BarsPeriodType.Minute, 10[/INDENT]
     }
    );
    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 kaywai, 09-01-2023, 08:44 PM
        5 responses
        601 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        22 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        16 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        229 views
        0 likes
        Last Post TradingLoss  
        Started by agclub, 04-21-2024, 08:57 PM
        3 responses
        17 views
        0 likes
        Last Post TradingLoss  
        Working...
        X