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

AddChartIndicator with Draw.Line on both price panel and subpanel?

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

    AddChartIndicator with Draw.Line on both price panel and subpanel?

    I wrote an indicator that explicitly draws lines on both price-panel and it's sub-panel by setting the appropriate Bool flag to draw on Price-Panel or Sub-Panel in the Draw.Line call.

    When adding this indicator inside a Strategy with AddChartIndicator , all lines are drawn on the Price-Panel.

    I can use DrawOnPricePanel = false; in (State == State.SetDefaults) to get lines drawn on the subpanel only but then lose the price panel lines.

    Is there a way to preserve the desired drawing panel location when invoked under a strategy with AddChartIndicator, when the indicator explicitly defines their panel location?


    #2
    Hello vollQ,

    Thank you for your post.

    Unfortunately, it would not be possible to draw on both price panels at once. Typically, you would usually need to use two indicators for that purpose.

    The sample script linked below demonstrates how to use dummy indicators to plot strategy data in both panels:



    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      I will have to refactor my indicator into 3 code bases. One where it as an indicator, and the other two to get the same visual effect when called within a strategy. This is not very friendly.

      Every Drawing method has a property "drawOnPricePanel" where an indicator developer can explicitly define whether the Draw object instance should display on the price or sub panel. This works fine and given that such capability is exposed must be supported.

      Would you consider an enhancement request where AddChartIndicator respects the indicator designer's wishes such that in order of precedence:

      a) check whether each Draw method call drawOnPricePanel has been explicitly set

      if not

      b) use DrawOnPricePanel setting to define where Draw objects show

      Comment


        #4
        Originally posted by volIQ View Post
        I will have to refactor my indicator into 3 code bases. One where it as an indicator, and the other two to get the same visual effect when called within a strategy. This is not very friendly.

        Every Drawing method has a property "drawOnPricePanel" where an indicator developer can explicitly define whether the Draw object instance should display on the price or sub panel. This works fine and given that such capability is exposed must be supported.

        Would you consider an enhancement request where AddChartIndicator respects the indicator designer's wishes such that in order of precedence:

        a) check whether each Draw method call drawOnPricePanel has been explicitly set

        if not

        b) use DrawOnPricePanel setting to define where Draw objects show
        I had the same problem with the Draw Lines Vertical across multiple panels. My solution was to not use the Draw Vertical lines. instead, I used the color background All for that bar to create the vertical line.
        RJay
        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,406 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
        160 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        9 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X