• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, Speriod);
    				AddDataSeries(Data.BarsPeriodType.Minute, Lperiod);
    				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 hatnaytr65, Today, 05:39 AM
        0 responses
        1 view
        0 likes
        Last Post hatnaytr65  
        Started by stefanrvc, Today, 04:59 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by 7robert, Yesterday, 08:30 PM
        2 responses
        16 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by pjsmith, Today, 01:13 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by yukashg, Yesterday, 09:56 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X