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 Orion815, 05-02-2024, 08:39 AM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by frenkmly, Today, 04:49 AM
        0 responses
        5 views
        0 likes
        Last Post frenkmly  
        Started by ETFVoyageur, Yesterday, 07:05 PM
        2 responses
        19 views
        0 likes
        Last Post bltdavid  
        Started by MGHORBEL, 05-06-2024, 06:41 AM
        4 responses
        23 views
        0 likes
        Last Post MGHORBEL  
        Started by ChastiJose, Today, 03:37 AM
        0 responses
        7 views
        0 likes
        Last Post ChastiJose  
        Working...
        X