Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print() - duplicates

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

    Print() - duplicates

    Hi,

    I'm trying to print some values for my strategy.

    Data Series type: Volume.

    I have added this piece below in my strategy;

    Code:
    protected override void OnBarUpdate()
    {
    Print(Time[1].ToString()+" The high of the bar is : " + High[1]);
    }
    But this is the output I'm getting, so many duplicates; any idea why?

    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:58:45 The high of the bar is : 1.23325
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335
    02/03/2018 21:59:07 The high of the bar is : 1.2335

    Thanks
    MT

    #2
    OnBarUpdate is called for every tick.

    You can change that:

    Comment


      #3
      Hi mntemel,

      sledge is likely correct.

      What is the Calculate setting set to in the instance parameters of the running script?
      (Not just in the code)

      If you would like to have Calculate set to On each tick, or On price change and receive only one print per bar, you can require that IsFirstTickOfBar be true.

      Below is a publicly available link to the help guide.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      67 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      41 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      202 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      366 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      284 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X