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

NT 8.1.2.0 code (BarLine as IDrawingTool).ZOrder = int.MaxValue; gives error

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

    NT 8.1.2.0 code (BarLine as IDrawingTool).ZOrder = int.MaxValue; gives error

    On Version 8.0.28.0, the following code compiles without error, however, when I migrated the code over to 8.1.2.0, it gives me an error: ')' expected. The error is on the second line of the code (BarLine as IDrawingTool).ZOrder = int.MaxValue; Anyone know why this code generated this error?

    NinjaTrader.NinjaScript.DrawingTools.Line BarLine = Draw.Line(this, tag, isAutoScale, startBarsAgo, startY, endBarsAgo, endY, brush, dashStyle, width);

    (BarLine as IDrawingTool).ZOrder = int.MaxValue;​

    #2
    Hello hotsalamii,

    Welcome to the NinjaTrader forums!

    The error that a closing parenthesis ')' is expected may imply that the syntax in the code above this point is incorrect somewhere.

    Also, it may not be necessary to cast this to IDdrawingTool to set the ZOrder as it is already a drawing tool.

    BarLine.ZOrder = int.MaxValue;
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I don't understand either why you would cast it to an IDrawingTool. It's already a Line which has more capabilities than an IDrawingTool so you're making it harder on yourself than necessary. Just change the line's ZOrder. There's no need to cast it at all.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        I removed the typecast from the code and it compiled fine. I am still curious as to why the error message about the error: ')' expected when trying to typecast.
        Thanks for the comment @NinjaTrader_ChelseaB​ and @QuantKey_Bruce

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        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,407 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        98 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
        161 views
        0 likes
        Last Post loganjarosz123  
        Working...
        X