Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Writing indicator for MarketAnalyzer - 60min bars and CalculateOnBarClose=false

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

    Writing indicator for MarketAnalyzer - 60min bars and CalculateOnBarClose=false

    I want to display how far an instrument moved in the last bar, e.g. 60 min time frame.

    I thought the easiest way to do this would be:

    Code:
    Value.Set(Close[0] - Close[1]);
    and then to choose the time frame when adding the indicator as a column to the Market Analyzer.

    I would like it to display how far it moved in the last 60 mins at any instant in time, not just the last 60 min bar on a chart i.e. 11:00 to 11:59. So I set CalculateOnBarClose to false.

    However this doesn't show the results I am expecting. I think this shows how far it moved since the close of the last bar.

    How should I achieve what I want? Shall I forget about trying to use 60 mins bars and use 10 second bars and just calculate the number of bars in a 60 min interval? Or is there a simpler way?

    Thanks

    #2
    adamus, correct this would show you how much the instrument moved since the Close[1].

    What were you looking for? The Range of the bar instead?

    Perhaps the High[0] - Close[1] and Low[0] - Close[1] difference taken as absolute would do?

    Comment


      #3
      It's difficult to be totally unambiguous about what I want, but i'll try.

      I want the column in Market Analyzer to show how far the instrument has moved in the last x time periods at any instant in time.

      i.e. if I choose 1 day, I want to see how far it has moved in the last 24 hours from now.

      if I choose 1 hour and it's 13:45, I want to see how far it's moved since 12:45.

      I initially thought it would be easiest to use the dataseries time frame to define what I want to see, but this isn't working the way I'm doing it - as you described.

      Comment


        #4
        adamus, I see what you're saying - then you would need to custom calculate your hour reaching back from current time on a finer series.

        Comment


          #5
          OK, I've done it like that. It works well, although I restricted the parameters to just the number of minutes, instead of allowing a choice of time frame units.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          43 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          25 views
          0 likes
          Last Post PaulMohn  
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          163 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          98 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          158 views
          2 likes
          Last Post CaptainJack  
          Working...
          X