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 elderan, Yesterday, 08:03 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by samish18, Yesterday, 08:57 AM
        8 responses
        25 views
        0 likes
        Last Post samish18  
        Started by DJ888, 04-16-2024, 06:09 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by RookieTrader, Today, 07:41 AM
        0 responses
        3 views
        0 likes
        Last Post RookieTrader  
        Started by maybeimnotrader, Yesterday, 05:46 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X