Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting IsGlobalDrawingTool

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

    Setting IsGlobalDrawingTool

    Using the following code segment:

    NinjaTrader.NinjaScript.DrawingTools.Line lt = Draw.Line(this, "lineGlobexHigh", false,Times[(int)sessionsType.RTH][0], globexHigh, Times[(int)sessionsType.RTH][0].AddHours(6.5), globexHigh,
    GlobexHighColor , GlobexHighStyle, GlobexHighWidth, true);

    lt.IsGlobalDrawingTool = true;


    I get the following compile error:

    "Property or indexer 'NinjaTrader.NinjaScript.DrawingTools.DrawingTool. IsGlobalDrawingTool' cannot be assigned to -- it is read only"




    How do I set the IsGlobalDrawingTool property of the horizontal line? Please note that line creation code compiles without errors and code works as expected.


    A second question.

    A line created as follows:

    NinjaTrader.NinjaScript.DrawingTools.HorizontalLin e hzl = Draw.HorizontalLine(this,"hz",2900, Brushes.Azure);


    The horizontal lines does not have the 'IsGlobalDrawingTool' property.


    How do you set up a global horizontal line?


    Thank you for you help.
    Last edited by kweiss; 09-08-2019, 01:47 PM.

    #2
    Hello kweiss, thanks for your note.

    You should use this constructor to make the line global:

    Code:
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY,[B] bool isGlobal[/B], string templateName)
    IsGlobalDrawingTool is read only, so there is a getter, but no setter.

    Please let me know if you have any additional questions.

    Comment


      #3
      I appreciate your quick reply. Please answer the second question:


      A line created as follows:

      NinjaTrader.NinjaScript.DrawingTools.HorizontalLin e hzl = Draw.HorizontalLine(this,"hz",2900, Brushes.Azure);


      The horizontal lines does not have the 'IsGlobalDrawingTool' property.


      How do you set up a global horizontal line?

      Thanks.

      Comment


        #4
        Hello kweiss,

        Thanks for your message.

        IsGlobalDrawingTool is read only and cannot be set programmatically. You will need to use an overload for Draw.HorizontalLine that allows creating Global Draw Objects.

        For example:

        Draw.HorizontalLine(NinjaScriptBase owner, string tag, double y, bool isGlobal, string templateName)
        Draw.HorizontalLine(this, "tag", Close[0], bool isGlobal, string templateName)

        You can reference documentation for Draw.HorizontalLine here - https://ninjatrader.com/support/help...zontalline.htm

        Please let us know if you have any additional questions.

        Comment


          #5
          Thank you for your explanation.

          Last edited by kweiss; 09-09-2019, 07:04 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X