Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting and Drawing on same panel

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

    Plotting and Drawing on same panel

    I have an Indicator that has both Plots and DrawLine statements.

    I have "Overlay" set true. I have "DrawOnPricePanel" set true.

    The Plots plot, but the DrawLines fail.

    Is there a trick to this?

    #2
    Hello TikDaddy,

    Thank you for your post.

    After you have added the indicator to your chart please go to the NinjaTrader Control Center and then the Log tab, do you see any error messages listed in Yellow?
    If so, please detail in your response.

    I look forward to assisting you further.

    Comment


      #3
      Thanks for a quick response.

      There are no errors showing in the log window after I load the indicator.

      Is there a common pitfall to this ( plotting and drawing on same pane )?

      Comment


        #4
        Hello TikDaddy,

        Thank you for your response.

        I am not aware of any items if you do in fact use the correct syntax for the methods.

        Can you provide a sample of your NinjaScript code and how you are calling the DrawLine() method?

        I look forward to assisting you further.

        Comment


          #5
          PatrickH
          Here is a drawline statement:

          DrawLine(
          "Trade"+TradeNum.ToString(),AutoScale,b-EntryBar,EntryPrice,0,EntryPrice+Gain,Color.Blue,DashStyle.Solid,2);

          Anything wrong?

          Comment


            #6
            Hello TikDaddy,

            Thank you for your response.

            Your Syntax appears to be correct for DrawLine(), however I do not know what the variables are exactly. Please use a Print() statement in your code to print these variables so we may know exactly what the DrawLine() method is being told to draw.

            For example:
            Code:
            Print("TradeNum.ToString(): " + TradeNum.ToString() + " b-EntryBar: " + b-EntryBar + " EntryPrice: " + EntryPrice + " EntryPrice+Gain: " + (EntryPrice+Gain));
            This Print in the Output window (Tools > Output Window).
            Please respond with the Output you are receiving.

            Comment


              #7
              Patrick,

              Below is typical output from the Print statement. It had a problem with concatenation so I printed separate lines. All appears normal.

              TradeNum.ToString():
              4
              b-EntryBar:
              3
              EntryPrice:
              1447.5
              EntryPrice+Gain:
              1448

              Comment


                #8
                Hello TikDaddy,

                Thank you for your response.

                Please send me your strategy or a 'toy' version of the strategy to support[at]ninjatrader[dot]com with "ATTN: Patrick" in the subject line and a reference to this thread: http://www.ninjatrader.com/support/f...ad.php?t=52928

                I look forward to assisting you further.

                Comment


                  #9
                  Patrick,

                  I am trying to buid a toy version, if only to use as a test bed for myself, and I am discovering problems that may relate to my issue.

                  All I really needed to know was that it is possible to both plot and draw on the same panel.

                  If I build a toy version, I should be able to work it out.

                  Thanks


                  .

                  Comment


                    #10
                    Originally posted by TikDaddy View Post
                    PatrickH
                    Here is a drawline statement:

                    DrawLine(
                    "Trade"+TradeNum.ToString(),AutoScale,b-EntryBar,EntryPrice,0,EntryPrice+Gain,Color.Blue,DashStyle.Solid,2);

                    Anything wrong?
                    This worked for me.

                    DrawLine("Trade"+"4",
                    true,
                    3,
                    1447.50,
                    0,
                    1448.00,
                    Color.Blue,
                    DashStyle.Solid,
                    2);

                    See attached image, about "R1" to the left.
                    Attached Files

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    649 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    370 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    109 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    574 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    576 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X