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

Getting the highest point from Barsarray[1] not loading the proper lookback

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

    Getting the highest point from Barsarray[1] not loading the proper lookback

    Hi,
    I added a second timeframe to my strategy and am trying to get the highest point from a specific range from the second timeframe.

    All appears to be ok..except for one thing. The lookback period is not functioning properly. I have set it to 722 bars and it appear to be loading just the last 24.

    Initialize
    Add(PeriodType.Minute, 60);

    OBU
    private int FibLookBack = 722;

    if (BarsInProgress == 1)
    {
    minLookback = MIN(Lows[1], FibLookBack)[1];
    maxLookback = MAX(Highs[1], FibLookBack)[1];
    PrintWithTimeStamp("Max is" + maxLookback);
    }


    Any idea how I can fix this?

    #2
    Hello nikolaalx,

    Thank you for your post.

    I see no issue with your code. How are you confirming that the lookBack is not running the full period?

    Comment


      #3
      Yes,
      from the printed output I see that the calculaiton is not corresponding to the highest/lowest values for the whole lookback period.

      Instead of the 722 period, it appears to be looking back just 20 bars.


      Originally posted by NinjaTrader_PatrickH View Post
      Hello nikolaalx,

      Thank you for your post.

      I see no issue with your code. How are you confirming that the lookBack is not running the full period?

      Comment


        #4
        Hello nikolaalx,

        Can you provide the code used for the Output and the actual Output as well?

        Comment


          #5
          I have disconnected from market replay and connected to real time Continuum in order to provide you the real output values..and it appears the bug was solved.

          Is there a particular reason why this has happened while in market replay mode...or it was rather a glitch?

          Anyway, It seems to have been solved, thank you for the help and the quick response!

          Originally posted by NinjaTrader_PatrickH View Post
          Hello nikolaalx,

          Can you provide the code used for the Output and the actual Output as well?

          Comment


            #6
            Hello nikolaalx,

            Thank you for your response.

            Was Market Replay loading enough bars? How many bars were on the chart in Market Replay?

            Comment


              #7
              There were plenty of bars. On the chart itself (I was able to see only the default bars) there were well more than enough.

              Sorry for the stupid question, but should I have loaded also the second timeframe on the same chart and does that make any difference?

              Comment


                #8
                Originally posted by nikolaalx View Post
                There were plenty of bars. On the chart itself (I was able to see only the default bars) there were well more than enough.

                Sorry for the stupid question, but should I have loaded also the second timeframe on the same chart and does that make any difference?
                If the second time-frame needed reloading of data that would be a good practice, there's a known limitation reloading historical data per our loading rules for the internally added series. Our next major platform update will improve the handling here.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by leojimenezp, Today, 08:40 AM
                2 responses
                8 views
                0 likes
                Last Post leojimenezp  
                Started by mtamaku, Yesterday, 11:08 AM
                11 responses
                25 views
                0 likes
                Last Post mtamaku
                by mtamaku
                 
                Started by ZeroKuhl, Today, 10:22 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gyilaoliver, Today, 03:31 AM
                4 responses
                19 views
                0 likes
                Last Post gyilaoliver  
                Started by vit007, Today, 05:09 AM
                3 responses
                28 views
                0 likes
                Last Post backtester831  
                Working...
                X