Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Add migrating strategy

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

    Help with Add migrating strategy

    Hello,

    I've an NT7 strategy that works with week and day levels, in the initzialize funcion I do:

    Code:
    Add(PeriodType.Day,1);
    Add(PeriodType.Week,1);
    An later I do:

    Code:
    if((magia(1,Highs[2][0], separator) || magia(1,Lows[2][0], separator)) || ( (magia(1,Highs[1][0], separator) || magia(1,Lows[1][0], separator))))
    Everything is happiness until I try to migrate it to NT8, when I get an index error. If I use an alternative way to get the daily levels, no problem, but I can get an alternative way to get the weekly ones.

    I change Add for the NT8 function, so the first code looks like:

    Code:
    AddDataSeries(BarsPeriodType.Day,1);
    AddDataSeries(BarsPeriodType.Week,1);

    #2
    Hello Barrenas, and thank you for your question. I recommend the following at the beginning of your OnBarUpdate. Please let us know if it does not resolve your query or if there are any other questions we may answer.

    Code:
    [FONT=Courier New]protected override void OnBarUpdate()
    {
        foreach(int CurrentBarI in CurrentBars)
        {
            if (CurrentBarI < 1)
            {
                return;
            }
        }
    
    ...[/FONT]
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    29 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    194 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    355 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    274 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X