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

Draw.Line() Global doesn´t works

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

    Draw.Line() Global doesn´t works


    Hi team,
    I am trying to draw a line from my indicator script and I want to this line be global, so I can see the line in the ES chart for candle or ticks, but it doesn{t works.
    I use the following code to draw the lines:
    PHP Code:
    Draw.Line(this,lineNameBefore+"2",truebasrAgo,barsAgoY,0,barsAgoY,""); 
    the results is in the screenshots.
    What I am doing wrong? the global only works with the same type of charts?

    Thanks in advance.

    Attached Files

    #2
    Hello Nutriax,

    Thanks for your post.

    A global draw object will appear on all charts of the same instrument (unless "show global draw objects" is specifically excluded in the Data series settings)

    In order to draw a global line you would need to use the Draw.Line() method overload that uses the bool IsGlobal. The one that fits what you have posted would be:

    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)

    Reference: https://ninjatrader.com/support/help...?draw_line.htm

    I will move this thread to the NinjaTrader8 indicators forum.
    Paul H.NinjaTrader Customer Service

    Comment


      #3

      Hello, thank you for your quick response on this.
      I already checked and I have enable the "show global draw objects" in the data series of the ticks chart, but it is not displaying the lines.
      Also I used the same reference that you sent and the lines are drawed in the original chart (which has the indicator) but not in other ones, as I show you in the previous screenshot.)
      What else can I try?

      Thank you for your help on this.

      Attached Files

      Comment


        #4
        Hello Nutriax,

        Are you using the Drawing method overload that allows specifying isGlobal like Paul suggests?

        When I test the method overload Paul suggests, I see the global drawing object on other charts of the same instrument.

        Please see the attached script and screenshot for a working example.
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Jim/Paul,
          Thank you very much for your support on this, its working now! I had a problem at my side and I was able to figure it out when I review the example code that you posted Jim.

          I really appreciate! thanks a lot!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by akm39, Today, 04:31 PM
          5 responses
          50 views
          0 likes
          Last Post akm39
          by akm39
           
          Started by Giorgetto, Today, 02:15 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by WalterSkinner, Today, 01:39 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by ernest93, Today, 01:08 PM
          1 response
          20 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by d122y, Today, 12:40 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X