• 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 Knortzsch, Today, 12:36 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by Wick Wrangler, Today, 12:42 AM
        0 responses
        8 views
        0 likes
        Last Post Wick Wrangler  
        Started by saltminer, Yesterday, 11:06 PM
        0 responses
        5 views
        0 likes
        Last Post saltminer  
        Started by saltminer, Yesterday, 10:14 PM
        0 responses
        6 views
        0 likes
        Last Post saltminer  
        Started by Mykro, Yesterday, 10:03 PM
        0 responses
        6 views
        0 likes
        Last Post Mykro
        by Mykro
         
        Working...
        X