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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      93 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      138 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      123 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      73 views
      0 likes
      Last Post PaulMohn  
      Working...
      X