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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    65 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X