Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator on different values

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

    indicator on different values

    If one has Calculate.OnEachTick but wants to get values such as the Max value in a bar of the MACD histogram, (set to 1min charts so 1min bars), how would they achieve this in the script?

    #2
    Hello Boonfly8,

    Thanks for your post.

    If you are looking for previous values you can just use the barsago of the MACd.diff plot

    If you are looking for the maximum movement during the current bar, the currently forming bar (and diff plot) may well change during the bar formation and the diff plot may grow larger or smaller depending on the relationship of the MACD and MACD.avg lines. If you are wanting to find the maximum movement of the plot during the current bar formation then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello Boonfly8,

      Thanks for your post.

      If you are looking for previous values you can just use the barsago of the MACd.diff plot

      If you are looking for the maximum movement during the current bar, the currently forming bar (and diff plot) may well change during the bar formation and the diff plot may grow larger or smaller depending on the relationship of the MACD and MACD.avg lines. If you are wanting to find the maximum movement of the plot during the current bar formation then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
      Hi Paul, thx for your note. I thought of simply using MACD.Diff[BarsAgo] but in this case if the strategy is set to Calculate.OnEachTick, the bars ago are tick changes where I need the maximum value of the bar of the histogram completed from my 1min chart.

      Comment


        #4
        Hello Boonfly8,

        Thanks for your reply.

        Just to be sure we are saying the same thing, MACD.Diff[0] will provide the current (tick) value of the MACD diff plot and may change on each tick until the bar closes at which point the diff value will be fixed and would be seen as historical. MACD.Diff[1] would be the prior bar completed and unchanging diff value, MACD.Diff[2] would be the completed bar before that, etc. etc.

        If you need the maximum that the diff plot was during the forming bar then you can accomplish this by saving the current diff value to a variable and then comparing the next ticks diff value to the variable and save if larger. At the end of the bar the maximum would then be in the variable. You would use if (IsFirstTickOfBar) as the start and end point.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X