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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        156 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        141 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X