Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add Plot Strategy

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

    Add Plot Strategy

    Hello,

    I have in an indicator plotting a horizontal line working ok with

    AddPlot(Brushes.Orange, "LineStyle"); and assigning a double to LineStyle[0] in the code of the indicator for plotting.

    When I do the same in a strategy it is not plotting the horizontal line. Why please?


    Thank you!
    Tony

    #2
    Hi tonynt, thanks for your note.

    A plot should work the same in a strategy as is does in an indicator. Did you add the public property "LineStyle" that returns Values[0][0]? What if you just set Values[0][0] to the double? Please also check the log tab of your control center for errors.

    I look forward to hearing of your results.

    Comment


      #3
      Hello,

      thank you for your reply. So with this information that it has to work same as in an indicator I started new and I could make it plotting with same logic as in the indicator. But I do not have the price of the lineplot on priceaxis on the right which my indicator does. What I see is that the programmer has in the indicator added
      DrawOnPricePanel = true;
      DrawHorizontalGridLines = true;
      DrawVerticalGridLines = true;
      PaintPriceMarkers = true;
      ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;

      I thought this might be the reason why it shows the price in the indicator on price-axis on the right but when I add these lines same as in the indicator to state.setdefaults then I get error messages for horizontal and vertical grid lines and paintpricemarkers when compiling.

      Thank you!
      Tony

      Comment


        #4
        Hi tonynt, thanks for your reply.

        A plot added by a strategy will not have a price marker. See this example on plotting from a NinjaScript strategy for more flexibility with plots such as plotting from other panels:


        Best regards.


        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        77 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X