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

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.

    Chris L.NinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        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 Christopher_R, Today, 12:29 AM
          0 responses
          6 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,235 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          7 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,415 views
          0 likes
          Last Post Traderontheroad  
          Working...
          X