Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawingTools.PriceLevel is not of type DrawingTools.PriceLevel

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

    DrawingTools.PriceLevel is not of type DrawingTools.PriceLevel

    Hello,

    A short description of my situation:
    • I implemented a drawing tool "Custom Fibonacci Retracements".
    • This drawing tool inherits from the default Fibonacci Retracements.
    • The custom part of the drawing tool is that the PriceLevel lines are drawn till the end of session and not till the right end of chart if "extend right" is checked.
    • This drawing tool is drawn by an Indicator for specific time frame which is entered as parameters.
    • The indicator also excepts a template name for the drawing tool.
    • I exported the Indicator and the drawing tool.
    • The export was imported both on five different PCs. 4 of them have no problems. 1 Throws the following exception:
      • System.ArgumentException: The value "NinjaTrader.NinjaScript.DrawingTools.PriceLev el" is not of type "NinjaTrader.NinjaScript.DrawingTools.PriceLev el" and cannot be used in this generic collection.
    • The Exception is thrown when the user tries to add a new price level or edit an existing one (e.g. change color).
    Up until now I was not able to identify the cause for this exception. I attached the trace file from the PC with the problem. I removed the accounts names, user names and so on from it.

    Any ideas or suggestions would be very welcome.

    Thank you all in advance.
    Last edited by NinjaTrader_ChrisL; 07-14-2021, 08:24 AM.

    #2
    Hi Victor, thanks for writing in.

    You can use Visual Studio to break at the line where the exception occurs, that can be helpful for finding the issue. Turn on debug mode, compile, and attach VS to the NinjaTrader.exe process, after that run the script to cause the exception and it will break where the exception occured.

    https://ninjatrader.com/support/help..._debugging.htm

    Kind regards,
    -ChrisL

    Comment


      #3
      Hello ChrisL,

      Thank you for the quick reply.

      It would be great if I could debug it. Sadly I do not have access to the PC with the error and I could not reproduce the error on any other PCs available to me.

      Kind regards,
      Victor

      Comment


        #4
        HI Victor, thanks for your reply.

        It's possible it is an error related to the specific environment. The user would need to test in a clean NinjaTrader 8 environment:

        To create a clean installation please follow the instructions below:
        1. Go to Documents\NinjaTrader 8 and copy your Config.txt file to the desktop, you will replace the new "Config.txt" with this saved copy so you don't have to enter your connection info and license key again.
        2. Exit the platform
        3. Go to (My) Documents > rename the 'NinjaTrader 8' folder to 'NinjaTrader 8.Prev'.
        4. Then re-install by running the installer from the following link: https://ninjatrader.com/GetStarted
        When you reinstall it will recreate the user folder you had just renamed with only stock files.

        Now you can start the platform and import the example.

        To switch between the two installs; shut down NinjaTrader > rename the new installation to 'NinjaTrader 8.Dev' under (My) Documents > then rename the 'NinjaTrader 8.Prev' to 'NinjaTrader 8'. NinjaTrader looks for the user folder named NinjaTrader 8 specifically.

        Comment


          #5
          I am having same issues when I copied the original fibtool to make custom changes in it.

          Can you please advice what was the solution for this? @Devside_Victor​ @NinjaTrader_ChrisL

          Comment


            #6
            Hello tradeesh,

            There was no update from the original poster as to what the solution was however, I would recommend ChrisL's approach to debug the script to identify the line of code causing the error.

            You can use Visual Studio to break at the line where the exception occurs, that can be helpful for finding the issue. Turn on debug mode, compile, and attach VS to the NinjaTrader.exe process, after that run the script to cause the exception and it will break where the exception occured.

            https://ninjatrader.com/support/help..._debugging.htm

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 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
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X