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

DrawEllipse

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

    DrawEllipse

    How can I draw an Ellipse around the current bar if I want to leave any space on either side of the bar?

    For example:

    DrawEllipse("mytag", CurrentBar-2, High[0], CurrentBar+2, Low[0], Color.Black)

    will give me an error about startBarsAgo being greater or equal to zero. In order to circle the current bar, it has to be.

    Any suggestions? Am I missing something?

    Thanks.

    #2
    The parameters are looking for "bars ago" and not the bar number. So instead of using CurrentBar - 2 just put in 2.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      That doesn't help me. Specifying 2 only draws on the left side of the current bar. You can't specify a negative number (-2) for the right side of the current bar, hence, I can't draw an ellipse around the current bar, right?

      Comment


        #4
        Unfortunately this is not possible at this time.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ellipse

          Originally posted by NinjaTrader_Ray View Post
          Unfortunately this is not possible at this time.


          I'm trying this:
          Code:
          DrawEllipse("ellipse"+CurrentBar,true,(indexa-1),High[indexa]+5*TickSize,(indexa+1),Low[indexa]-5*TickSize,Color.Navy,Color.Gold,3);
          Any way to draw this without the error apparently induced by the
          Code:
          (indexa+1)
          ??

          Comment


            #6
            Hello zeller4,

            Thank you for your post.

            You could use the following but keep in mind the -1 value would need a bar to pull from so this would need to be when using CalculateOnBarClose = true:
            Code:
            			if (CurrentBar <= 1)
            				return;
            			
                        DrawEllipse("tag", 1, Close[1], -1, Close[-1], Color.Black);
            You may wish to look into custom drawing. An example can be found under Tools > Edit NinjaScript > Indicator > CustomPlotSample. This shows how to override the Plot method for custom drawing.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            17 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            5 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,786 views
            0 likes
            Last Post Leafcutter  
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,408 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Working...
            X