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 Barry Milan, Yesterday, 10:35 PM
                5 responses
                16 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Started by DJ888, 04-16-2024, 06:09 PM
                4 responses
                12 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                11 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                8 views
                0 likes
                Last Post nandhumca  
                Working...
                X