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 JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Working...
        X