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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        67 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        142 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        76 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        47 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X