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

optimizing error

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

    optimizing error

    Code:
    Time	Category	Message
    11/14/2017 5:14:56 AM	Default	Strategy 'SlopeRegv2v8': Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.
    Basically, I have two data series within my strategy that are different from each other. One dataseries is applied to an indicator to generate long signals and the second dataseries is applied to an indicator to generate short signals.

    Now, I'm trying to optimise the Int value for the data series. In other words, optimising the below (bolded):

    Code:
    			{
    				AddDataSeries(Data.BarsPeriodType.Minute, [B]Speriod[/B]);
    				AddDataSeries(Data.BarsPeriodType.Minute, [B]Lperiod[/B]);
    				SetProfitTarget("", CalculationMode.Percent, PT);
    			}
    			else if (State == State.DataLoaded)
    			{				
    				LinRegSlope1				= LinRegSlope(Closes[1], Convert.ToInt32(SlopeS));
    				LinRegSlope2				= LinRegSlope(Closes[2], Convert.ToInt32(SlopeL));
    			}
    But the optimiser in strategy analyser is giving me the above error. Why? The reason why I needed to do this is because I have one strategy that follows similar rules to generate long/short signals. Initially, I created the "long signal" generating strategy separately and a "short signal" generating strategy separately. In those strategies, I did not specify the data series period (Minute, Speriod /eriod) because during optimisation, I could simply optimise the dataseries using strategy analyser. But when I compared the optimised trades based on the two different strategies, I was receiving conflicting trade signals, in other words, there were times where long and short positions were both live. I want to avoid that, therefore, I thought I'd be able to combine both individual long/short generating strategies into one single strategy and optimise the dataseries for individual long/short periods within the same strategy. But the above error..

    Thanks

    #2
    Hello calhawk01,

    Thanks for opening the thread.

    This error would be expected in the Optimizer when attempting to add secondary data series using user input variables.

    From the helpguide:
    • Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.
    We are tracking interest in this as a feature request, however. It is being tracked with ticket ID: SFT-882 I will add a vote for this feature request on your behalf.

    This feature's implementation can be found in the Release Notes of the version of NinjaTrader 8 that includes the feature. You can find the Release Notes here: https://ninjatrader.com/support/help...ease_notes.htm

    Feature requests are fulfilled based on our development team's schedule and priorities and we cannot provide a time frame for it to become available.

    You could also devise a workaround by hard coding each additional data series into the strategy and use a parameter in your code to determine which BarsInProgress to use for your strategy logic.

    I have provided a link to our publicly available documentation on BarsInProgress for the thread's reference - https://ninjatrader.com/support/help...inprogress.htm

    If there is anything else I could do to help, please let me know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Please add my vote to feature request ticket ID SFT-882 (dynamically adding secondary data series).

      Thanks.

      Comment


        #4
        Hello digibob,

        Thank you for your reply.

        I have added a vote for you to SFT-882.

        As my colleague Jim mentioned previously in this thread, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        9 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,235 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        3 views
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        8 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,415 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X