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

Secondary Series doesn't load in Historical? Therefore no bars to error

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

    Secondary Series doesn't load in Historical? Therefore no bars to error

    I've had issues with a Strategy - It has a secondary series indicator... that indicator runs fine in it's chart since there is historical data, and OnMarketData picks up that data.

    But when using the indicator in a strategy - I can not enable my strategy until that secondary indicator is live at 8am and spitting out new datas.

    *I've also experienced this in NT8. I added the main indicator to a chart with no historical data. Indicator kept complaining about bars -2. I kicked off NT8 with reimport of data... and what do you know - the indicator was chewing off the last historical data and working.

    Which leads me to my hypothesis - a strategy with such an indicator in live with an added data series doesn't use historical with OnMarketData?

    Is this a known?
    Am I off base?
    Do I need to prove my case beyond a reasonable doubt?

    I'd love to setup my strategy when setting up Sunday night... I really don't want to put time conditions in for this.... but something isn't right.

    Maybe someone out there has a clue. But I think I'm on to something....

    #2
    Hello sledge,

    Thank you for your post.

    Can you detail this a bit further?
    OnMarketData() will only work in real-time, meaning there are no historical calls to OnMarketData().

    You state your indicator works fine on it's own chart, so does it really rely on OnMarketData() only for it's values?

    It would be helpful to understand the full code here, would you be able to provide the indicator?

    I look forward to your response.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello sledge,

      Thank you for your post.

      Can you detail this a bit further?
      OnMarketData() will only work in real-time, meaning there are no historical calls to OnMarketData().

      You state your indicator works fine on it's own chart, so does it really rely on OnMarketData() only for it's values?

      It would be helpful to understand the full code here, would you be able to provide the indicator?

      I look forward to your response.
      Thanks, I am working on a sample code, and will need to work in a strategy.

      I am using a Timer, which is requesting/assigning things that I am expecting to be filled in from OnMarketData.

      When there is historical data - the timer fires - it picks up the last bar on the chart, assigns the values, which implies OnMarketData has fired and picked up the historical bar on the chart.

      If there is no data, it all falls apart.

      My premise is that the strategy - isn't getting that data value from the added indicator attached to a chart, and hence never starts up until there is a real bar on the added indicator...

      I suspect a CurrentBar check somewhere in OnBarUpdate or the Timer code would help.

      My Indicator did function the same in NT8 as NT7 today.. (*after conversion to private Series<double> ).

      I have some more tests to run, but I am still certain, that adding my indicator to a strategy with this Timer, it doesn't chew for hours overnight on the last bar as it does on the chart and hence throws the not enough bars error, and why I have to enable Monday morning after 8am when the datafeed starts putting out data.

      This is rather complicated, as NT7 doesn't record DailyHigh/DailyLow, so hence I had to build something that did, and I used a Timer to build a dataseries and output it.

      I'll have more to follow in a week or so with test code.

      *this is appears to be like a chicken/egg problem... but it when flattened to both inputs it boils down to -> "do I have historical data to use" problem... chart -> yes, strategy-> as added indicator series -> No.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AttiM, 02-14-2024, 05:20 PM
      11 responses
      184 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by fernandobr, Today, 09:11 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by timmbbo, Today, 08:59 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by KennyK, 05-29-2017, 02:02 AM
      2 responses
      1,281 views
      0 likes
      Last Post marcus2300  
      Started by itrader46, Today, 09:04 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X