Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi timeframe strategy - IsFirstTickOfBar of non-processing BarsArray

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

    Multi timeframe strategy - IsFirstTickOfBar of non-processing BarsArray

    Within a multi timeframe Strategy, is it possible to access IsFirstTickOfBar for a BarsArray that is not currently processing?

    For example, where a Strategy has two BarsArrays, while the Primary BarsArray is processing (BarsInProgress == 0) accessing IsFirstTickOfBar of the Secondary BarsArray? Illustrated by the below (non-functioning) snippet.
    Code:
    protected override void OnBarUpdate()
    {
      if (BarsInProgress != 0) return;
      var secondaryBarsArrayFirstTickOfBar = [B]BarsArray[1].IsFirstTickOfBar[/B];
    }
    While the above example is simple, I require IsFirstTickOfBar from multiple BarArrays accessible from BarsArray[0].

    #2
    Hello Shansen,

    The IsFirstTickOfBar is a bool that is only true when the first tick of a bar (for the processing series) triggers OnBarUpdate.

    This would not allow for checking to see if a specific historical bar was the first tick of the bar (for any series).

    I will submit a feature request on your behalf for the NinjaTrader Development to consider creating the IsFirstTickOfBar as a method that accepts a barsAgo value.

    Once I have a tracking ID for this request I will forward this to you for future reference.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      For clarity, I am chasing IsFirstTickOfBar for the CurrentBar of a BarsArray at a point where the BarsArray is not processing (i.e. BarsInProgress).

      In pseudo-code I am chasing "BarsArray[1].IsFirstTickOfBar" which is accessible at a point where BarsArray 1 is not processing (where BarsArray[1] could be BarArray[x]).
      I am not chasing IsFirstTickOfBar for a historical bar, in pseudo-code "IsFirstTickOfBar[1]" (with a barsAgo parameter of 1).

      Comment


        #4
        Hi Shansen,

        Thanks for clarifying.

        I've submitted a request for a IsFirstTickOfBarByIndex method that would allow other bars in progress to check if the most recently processed tick was the first tick of the bar for that series.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Shansen,

          Your request for IsFirstTickOfBarByIndex method to allow bars in progress to check recent processed first ticks for a bar for that series is being tracked with ID #SFT-3085.

          Please note it is up to the NinjaTrader Development to decide if and when a request will be implemented.

          Thank you for your suggestion.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Nice notice. However, the solution seems to use something like this;

            Code:
            OnBarUpdate()
            {
               if(BarsInProgress==0)   isFirstTk = IsFirstTickOfBar;
            
               if (BarsInProgress != 0) return;    ...
               ...
            
               if (BIP==1 && isFirstTk ) ....
            
            }
            Last edited by ttodua; 02-05-2019, 07:57 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            56 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            132 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 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
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X