Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What does "bars ago" mean in Strategy Builder? Example

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

    What does "bars ago" mean in Strategy Builder? Example

    I'm trying to configure an automated strategy where I either enter long or short based on whether the previous bar had more volume up than volume down.
    So if I'm on a new bar now and it's time to calculate an entry, I'm looking at the previous bar for that.
    Does this mean that I put "1" in "bars ago" on both the left side and right side of the operator/condition?

    #2
    Hi MatthewLesko,
    I assume, you use Calculate.OnBarClose and compare Up and Down Volume for full bars.
    If true, ...
    BarsAgo index refers to closed bars. The currently forming bar is not (yet) accessible.
    BarsAgo "0" refers to the most recent (already) closed bar.
    BarsAgo "1" refers to one bar before (= elder) the most recent closed bar.
    NT-Roland
    Last edited by NT-Roland; 05-24-2021, 02:48 AM.

    Comment


      #3
      Hello MatthewLesko,

      Thanks for your post.

      As forum member NT-Roland hinted when using Calculate.OnBarClose, the "current bar" would be the "just" closed bar have a bars ago of 0 (zero) and the prior bar would [1] and the bar before that [2], etc. etc.

      In the cases of Calculate.OnPriceChange or Calculate.OnEachTick, on live or playback with market replay data only, the bar references change and the bar that is currently forming would be [0], the just close bar would now be [1].

      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NT-Roland View Post
        Hi MatthewLesko,
        I assume, you use Calculate.OnBarClose and compare Up and Down Volume for full bars.
        If true, ...
        BarsAgo index refers to closed bars. The currently forming bar is not (yet) accessible.
        BarsAgo "0" refers to the most recent (already) closed bar.
        BarsAgo "1" refers to one bar before (= elder) the most recent closed bar.
        NT-Roland
        Thanks so if I have 3 bars, and I'm at the start of a 4th bar, is the 4th bar where the "bars ago" is starting from?
        So if I have "1 bars ago" on the left side, it's referring to the state of MACD for bar #3?
        And if I have "1 bars ago" on the right side, it's referring to the state of MACD for bar #2?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        4 responses
        20 views
        0 likes
        Last Post alifarahani  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by PhillT, Today, 02:16 PM
        2 responses
        7 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by Kaledus, Today, 01:29 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frankthearm, Yesterday, 09:08 AM
        14 responses
        47 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X