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

Using PriceLevel in Drawing Tool Property

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

    Using PriceLevel in Drawing Tool Property

    I am using the built-in PriceLevel class in a custom Drawing Tool property
    Code:
    [Display(Name = "Long Measure 1", GroupName = "Measured Move Lines", Order = 82)]
    public PriceLevel LongMeasure1 { get; set; }
    When I open up the Drawing Tool properties it shows the namespace & class name (NinjaTrader.NinjaScript.DrawingTools.PriceLevel) next to the property editor.

    Click image for larger version

Name:	Image.png
Views:	118
Size:	2.5 KB
ID:	1191339

    Is it possible to configure the property so the namespace & class does not show?

    Thanks,
    Greg
    The Trading Mantis
    NinjaTrader Ecosystem Vendor - The Trading Mantis

    #2
    Hello gregschr,

    You would need to structure your class similar to the scripts which utilize PriceLevels type which includes adding the inheritance to the class PriceLevelContainer. For example the Fibonacci retracements is created by inheriting from FibonacciLevels which inherits from PriceLevelContainer or the base type that controls the PriceLevels property. If you look in the file PriceLevels.cs you can find PriceLevelContainer class and inside that class is the property "PriceLevels" which you would be using by inheriting PriceLevelContainer on your custom class.

    If this is a tool that you plan to export as a compiled assembly keep in mind that inheriting from the existing types in the drawing object folder will not work. In that use case you would need to create your own additional classes with custom names and then copy the various code from PriceLevels.cs into those new classes, essentially duplicate and rename where needed. Your script would then inherit from your custom base class (PriceLevelContainer renamed) which contains the price levels to be used with your tool. You would also need to make sure the custom PriceLevel type renamed points to the renamed PriceLevelTypeConverter that you made in the type converter used on that class.


    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse, Thanks for the detailed response on how correct this. Also, appreciate the heads up about exporting the compiled assembly!
      The Trading Mantis
      NinjaTrader Ecosystem Vendor - The Trading Mantis

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bmartz, 03-12-2024, 06:12 AM
      4 responses
      31 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      12 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by cls71, Today, 04:45 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X