Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Indicator is not printing drawings on chart every day

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

    Custom Indicator is not printing drawings on chart every day

    Hello,

    I have created a indicator, mainly to serve as a visual aid in larger back-tests, that draws dots, texts and lines on key price points to show if specific patterns are forming.

    I have also written this indicator as a 'strategy' so that I may place it in a back-test to see if the logic is calculating correctly in the output window with prints. This has in fact shown that it does calculate correctly when patterns are found; however, the problem is that they only print on the chart in the last calculated instance from the loaded data.

    As shown below, I have loaded three days worth of data but it only printed on chart on the last day (green circle) when it also should have printed on chart on prior days as well (red circles).
    The blue diamond shows a cancellation, or where to stop monitoring for the forming pattern. In this case it only printed on day two. The output shows that the blue diamond should have also printed on day one which says "xxxxxx[87]DownMomentumMove is cancelled...."

    This is the syntax I used to draw the dots and texts on the chart. This sentence pair of logic also applies for all of my other prints and shapes on the chart.
    {
    Draw.Dot(this, "DownA", true, LegConsecutiveBars - 1, DownA, Brushes.Gold); //Marks dot on chart for DownA
    Draw.Text(this, "DownAtext", "DownA", LegConsecutiveBars - 1, DownA + 2, Brushes.LightBlue); //Marks text on chart for DownA
    }

    What may be the issue that prevents it from printing it every day on historical data?



    ​ Click image for larger version

Name:	Indicatorstrategy prints.png
Views:	333
Size:	394.8 KB
ID:	1215723

    #2
    Hello Don22Trader1,

    Thank you for your note.

    The issue is that you're not drawing the objects with unique tags, so when you go to draw a new object, it updates the old one to the new position instead of drawing a completely new object. Try adding the CurrentBar to the tags for each drawing object to make them unique:

    Code:
    Draw.Dot(this, "DownA" [B]+ CurrentBar[/B], true, LegConsecutiveBars - 1, DownA, Brushes.Gold); //Marks dot on chart for DownA
    Draw.Text(this, "DownAtext" [B]+ CurrentBar[/B], "DownA", LegConsecutiveBars - 1, DownA + 2, Brushes.LightBlue); //Marks text on chart for DownA
    ​Please let us know if we may be of further assistance to you.

    Comment


      #3
      NinjaTrader_Kate,

      Yes, that fixed my problem.

      Thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X