Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Default Number of Bars in Data Series on Strategy Builder

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

    Default Number of Bars in Data Series on Strategy Builder

    I am in the STRATEGY BUILDER. I want to make sure there are at least 10 bars loaded every time the strategy starts.
    Is there a setting?
    How do I make sure I have the minimum bars loaded?
    Thanks in advance for your help!

    #2
    Hello smartmoneymom,

    You can either make any condition that uses 10 bars ago or make a condition to check if the Misc -> CurrentBar is greater than 10. Any condition you make that includes 10 bars ago will automatically generate the condition to require that number of bars before processing.

    Comment


      #3
      Thank you Jesse!

      Comment


        #4
        Jesse,

        Is there a way to make sure the Day data is loaded into each of the different Highs, Lows, Times etc for a specific number of days back?

        Currently I am adding a day series
        if (State == State.Configure)
        {
        AddDataSeries(Data.BarsPeriodType.Day, 1);
        }

        Then Checking CurrentBars as suggested:
        if (CurrentBars[1]>5)
        {
        int test=1;
        }

        But when I try Times[1][2] I receive the index out-of-range error. Hopefully what I am asking makes sense.

        Thank you,
        Jeremy

        Comment


          #5
          Hello jtaeoalii,

          You would use a CurrentBars condition for that. It looks like you have that condition but its not returning, this is what you would generally use:

          if(CurrentBars[0] < 10 || CurrentBars[1] < 10)
          return;

          the code below this statement would need 10 bars to work.

          Comment


            #6
            Thanks Jesse. I understand now. Is there another way to accomplish this? So, the problem when you are doing strategy Analyzer, is that you will have to make sure that you set the start date as 10 days from when you actually want to start, because on the first 10 days, you are just returning so you are basically skipping those days. I haven't yet tested in playback or live, but I am hopeful it will do as your suggesting.

            If there is no other way, then this will work, but I wanted to make sure.

            Thanks again!
            Jeremy

            Comment


              #7
              Hello jtaeoalii,

              If you have a daily data series and a condition like the one I had posted that would make it wait 10 days.

              10 daily bars would be 10 days of data so waiting until 10 OnBarUpdate calls have happened for the daily series means that you waited for 10 days of data to be processed.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              62 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 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