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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        601 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 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
        559 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