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

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.
    Chris L.NinjaTrader Customer Service

    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.


        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        7 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X