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 fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,404 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            95 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            159 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X