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

Loading weekly data for indicator on daily chart strategy

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

    Loading weekly data for indicator on daily chart strategy

    I have the following:
    Code:
    else if (State == State.Configure)
                {
                    AddDataSeries("6E 03-24", Data.BarsPeriodType.Week, 1);
                    AddDataSeries("6B 03-24", Data.BarsPeriodType.Week, 1);
                    
                }​
    and am using this as the input series for 2 custom indicators:

    Code:
    else if (State == State.DataLoaded)
                {                
                    COTIndex1                = COTIndex(Closes[1], true, true, true, true, IdxPeriod, 80, 20);
                    COTIndex2                = COTIndex(Closes[2], true, true, true, true, IdxPeriod, 80, 20);​
    I then run the strategy script on a daily chart of EURGBP. I get the error: COTIndex tried to load additional data. All data must first be loaded by the hosting NinjaScript in it's configure state. Attempted to load EURGBP Default: Weekly.

    Why is it attempting to load EURGBP when I added the 6E and 6B data series in the configure state? The hosting strategy script should be running on a daily EURGBP chart.

    #2
    Hello Lance El Camino,

    That message would indicate that the custom indicator that you are using also has its own AddDataSeries statements in its code. The strategy also needs to add the same series that the indicator does in its code. If the indicator loads a EURGBP Default: Weekly bar series you also need the same AddDataSeries for that series in the strategy so the indicator can use it.
    JesseNinjaTrader Customer Service

    Comment


      #3
      That's exactly what I did in the configure state as shown. I found the problem, I had AddChartIndicator in the data loaded state and it wasn't set to Closes[1] or Closes[2]. That is what was trying to reference EURGBP but COTIndex won't work with that data series.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by llanqui, Today, 03:53 AM
      0 responses
      5 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Working...
      X