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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    58 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    46 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    37 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    156 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X