• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to plot a horizontal line in panel 2 from a strategy

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

    How to plot a horizontal line in panel 2 from a strategy

    I am struggling to find the correct solution for plotting a horizontal line at a set value in a panel that is not the price panel from a strategy.

    #2
    Hello Rugosoft,

    Thanks for your question.

    If you have a strategy that adds indicators with AddChartIndicator and those indicators have additional panels added, you can use that indicator as the base NinjaScript to draw to that panel.

    I have attached an example. The same approach can be taken with Draw.HorizontalLine().

    I look forward to assiting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,

      I understand the example, but when the strategy does not define the second panel (like in your example)how then to draw a line on that panel from the strategy. I have an indicator configured on the chart that is not controlled from the strategy and I would like to draw a horizontal line in that panel when a certain condition is met. The status of that logic is determined in the strategy and not by the indicator.

      Thanks for your help,

      Comment


        #4
        Hello Rugosoft,

        The strategy will need to instantiate the indicators and also add them with AddChartIndicator. The strategy will not have knowledge of the other indicators on the chart, so they would have to be added following the example I provided if you would like to draw to those panels from the strategy.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nomadmilo, Today, 04:05 AM
        2 responses
        12 views
        0 likes
        Last Post nomadmilo  
        Started by Slaywer, Today, 05:17 AM
        0 responses
        4 views
        0 likes
        Last Post Slaywer
        by Slaywer
         
        Started by Balage0922, 10-01-2019, 11:09 AM
        5 responses
        72 views
        0 likes
        Last Post Fecdzo
        by Fecdzo
         
        Started by Knortzsch, Today, 12:36 AM
        2 responses
        15 views
        0 likes
        Last Post Knortzsch  
        Started by Wick Wrangler, Today, 12:42 AM
        0 responses
        10 views
        0 likes
        Last Post Wick Wrangler  
        Working...
        X