Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not Plotting

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

    Not Plotting

    I'm new to coding strategies and indicators..

    I ran through the strategy builder to test a simple feature like plotting an up arrow when the bar closes when the close is higher than the open price..

    But It's not plotting anything on the chart...

    Here is the code the builder produced.


    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;

    if (CurrentBars[0] < 0)
    return;

    // Set 1
    if (Close[0] > Open[0])
    {
    Draw.ArrowUp(this, @"MyPlotTest Arrow up_1", false, 0, 0, Brushes.Lime);
    }



    And another simple question is the price chart the chart where the candle sticks are? and is the indicator chart a different panel?


    Thanks
    Bruce

    #2
    Hello traderhawk,
    Price panel is where the candlesticks are & other panels can be indicator panels e.g. RSI is plotted on new lower panel. You code should draw 1 Arrow Up but it will be drawn @ 0 level, you can go to Drawing Objects to see it. Either you can change auto scale from drawing objects or code itself so then it will be visible on your chart.
    Generally we keep the chart markers near price so that they are visible e.g. Low[0] or High[0]. If you need multiple markers then make the tag dynamic by adding CurrentBar in tag name.
    Hope it helps!

    Comment


      #3
      Ok thanks for the clarity on where you see the drawing objects..

      But why doesn't the code I posted which was generated from the strategy builder work? Is there more code required?

      Looking at the reference docs..and looking at some syntax options ..

      Draw.ArrowUp(NinjaScriptBaseowner, string tag, bool isAutoScale ,int barsAgo, double y, Brush brush, bool drawOnPricePanel)

      Do I need to tell NT what Panel to place the draw object? Then why wouldn't the strategy builder know that? Or do I have to tell it..

      It's a little confusing as not many samples..

      I tried this as well and still didn't work...

      Draw.ArrowUp(this,@"MyPlotTest Arrow up_1", true, 0, Low[0]-TickSize, Brushes.Lime, true);
      Last edited by traderhawk; 07-15-2021, 09:53 PM.

      Comment


        #4
        Hello traderhawk,
        You don't need to specify any panel or extra code for this. Let me attach a sample code for drawing Arrow Up. Just in case you don't see the arrows, be sure to enable the Strategy either from Strategies dialog or Control Center - Strategies.
        Hope it helps!
        Attached Files

        Comment


          #5
          Thanks Heaps.. S.Kinra.. I had to enable the strategy in the control center under the Strategies TAB... I also used your code and works well thanks.

          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