Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to say that something had happened on a High/Low of a bar?

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

    How to say that something had happened on a High/Low of a bar?

    Hello,

    how can I create a condition where I would like to find if something had happened on a Low or High of a bar? Would it differ when calculating OnBarClose and OnEachTick?

    Thank you

    #2
    Hello emuns,

    Thank you for your post.

    Current High and Low values for the currently forming bar can be accessed with High[0] and Low[0]. If you're calculating OnEachTick, these values will be updated in real time as new highs or lows are reached by the bar. Calculating OnBarClose means that these will return the final high and low for the bar and won't update intrabar.

    I'm not sure what you mean when you mean when you say find if something happened on the high or low of a bar. Could you be more specific about what you're trying to do?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hello Kate,

      sorry. I´m trying to create Unfinished auction indicator. Start seems to be clear:

      long askVolume = barsType.Volumes[CurrentBar].GetAskVolumeForPrice(Close[0]);
      long bidVolume = barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]);

      if(askVolume > 0 && bidVolume > 0)

      ...but how to say that I mean ask and bid volume on a high or low of a bar?

      Thanks in advance,
      emuns

      Comment


        #4
        Hello emuns,

        Thank you for your reply.

        If you mean you want the volumes for the high price and the low price, you'd want to probably do this on bar close, but I'm not sure how you're wanting to use this exactly.

        GetAskVolumeForPrice and GetBidVolumeForPrice will get the volumes for a specific price. So, to get the ask volume at the high, you'd use

        long askVolume = barsType.Volumes[CurrentBar].GetAskVolumeForPrice(High[0]);

        If you wanted the volume for the low, you'd replace High[0] with Low[0].

        If you run this on each tick, you'll see the value of askVolume change as the volumes and high price changes. If you run it at the end of the bar, it'll give you the end result.

        Please let us know if we may be of further assistance to you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        50 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        69 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        36 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        97 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        60 views
        0 likes
        Last Post PaulMohn  
        Working...
        X