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 tsantospinto, 04-12-2024, 07:04 PM
      7 responses
      126 views
      0 likes
      Last Post aligator  
      Started by futtrader, 04-21-2024, 01:50 AM
      5 responses
      56 views
      0 likes
      Last Post NinjaTrader_Eduardo  
      Started by PeakTry, Today, 10:49 AM
      0 responses
      2 views
      0 likes
      Last Post PeakTry
      by PeakTry
       
      Started by llanqui, Today, 10:32 AM
      0 responses
      5 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by StockTrader88, 03-06-2021, 08:58 AM
      45 responses
      3,994 views
      3 likes
      Last Post johntraderuser2  
      Working...
      X