Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing object in strategy

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

    Drawing object in strategy

    Hi,

    Can a strategy plot object on the chart? I'm asking because I'm unable to see my object (i.e rectangle) when I'm running the strategy however, I have no problem drawing the same object when I write an indicator.

    Thanks,
    Ofir

    #2
    Hello ofiramitai,

    Thanks for your post.

    Yes, the strategy can use the draw methods to draw on the price panel of the chart.
    If the strategy is not drawing the object when you run, please check your "Log" tab in the NT8 control center for any error messages.

    You may want to use print statements to print the values used to draw the rectangle as well as any values used to decide when to draw the rectangle. Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

    Comment


      #3
      Thank you for the quick reply.

      I'm using this simple code and I don't see anything on the chart. The Log doesn't say anything either. Any hidden setting I'm missing?

      Print("Start");
      //Draw.Diamond(this, "a" + CurrentBar.ToString(), true, 0, Close[0], Brushes.Red);
      Draw.Dot(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Red);
      Print("End");

      Comment


        #4
        Hello ofiramitai,

        Thanks for your reply.

        Your code looks fine however with the Draw.Dot you will only see the latest one based on the use of the same tag name.
        You may want to move the dot further away from the bar to ensure visibility and/or left click on the bars and then hold down Ctrl and Shift key and use the mouse wheel to scroll through the drawing layers just to ensure the object(s) are not hidden. You may also want to use a different color if your candles/bars are also red.

        You could also create a new strategy with only the draw statements to verify functionality.

        Comment


          #5
          Thanks Paul for the reply.

          I'm sorry but I'm totally at a loss. I've reinstalled NT8 and created a new strategy with two lines and I still can't see the shape or text.

          Draw.Diamond(this, CurrentBar.ToString(), true,0, Low[0], Brushes.Red);
          Draw.Text(this, "aaa", "gsg gsgsdggs", 0, 2885);

          Comment


            #6
            Hello Ofir,

            Thanks for your reply.

            I've created a new strategy using your code (modified the Y-axis location for visibility) which I would ask you to download and install and apply to a 1 minute chart of any instrument you have data for.

            Here is what it looks like on my end with ES 09-19 1 minute and what the strategy looks like which is also attached. as you can see the red diamons appear below ever candle. the text is applied to the latest candled above the high of the candle.


            Click image for larger version

Name:	Ofir-1.PNG
Views:	796
Size:	107.0 KB
ID:	1070038

            [ATTACH]n1070039[/ATTACH]


            Please let us know if this does not display on a new chart, without any templates or other indicators applied to it.

            Comment


              #7
              I found my problem thanks to the screenshot you provided. I was adding the strategy using the center window and not the chart.

              Thanks a lot Paul

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              44 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              65 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              42 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X