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 geddyisodin, Today, 05:20 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        3 responses
        32 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by timko, Today, 06:45 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        6 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X