Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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'.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X