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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          345 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X