Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion between to Doubles

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

    DrawRegion between to Doubles

    Hi there,

    How can I draw a region between two Doubles? Im am trying to do this:

    DrawRegion("hPiv" + sessionCount,Bars.BarsSinceSession,0,hPiv, hPiv-2*TickSize,Color.Red,Color.Red,4);

    Where hPiv is a Double.

    But of course it wont work because I need to pass a IDataSeries not a double.

    How can I get around this?

    thanks

    #2
    That's correct GKonheiser, you would need to have at least one series for the DrawRegion call.



    One workaround would be storing the hPiv value into a custom dataseries value first in your OnBarUpdate() and then using this series as 'anchor'.

    Comment


      #3
      Thanks for that. Bertrand if I want the line to start from the bar when the condition becomes try and not from the start of the session what should I use as a start instead of Bars.BarsSinceSession?

      Comment


        #4
        Just save the barnumber then when you're condition triggered, so that you have a reference to know how many bars ago it occurred - which you could then in turn in your DrawRegion call.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, 03-23-2026, 04:31 AM
        0 responses
        74 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        313 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        311 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        148 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        111 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X