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, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      41 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X