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 NullPointStrategies, Today, 05:17 AM
      0 responses
      51 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      128 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 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