Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug with if FirstTickofBar in multi

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

    Bug with if FirstTickofBar in multi

    Hi,
    I am experimented in Ninjatrading but I have a particular probleme :

    I have a strategy in ReversalBarsType 20

    if (FirstTickOfBar)
    {
    PlaySound(@"C:\Program Files (x86)\NinjaTrader 7\sounds\AutoTrail.wav");
    }
    Works very well BUT if I add :
    protected override void Initialize()
    {
    Add(Instrument.FullName,PeriodType.Tick, 50); // [1]
    }

    if FirstTickOfBar ring on first bar of Tick 50 !!!!!!!!!!!!!!!!
    and not first bar of ReversalBars Type

    I am looking for something like that
    if (FirstTickOfBar[0])
    {...}

    Damned, what can i do ?

    Thanks for your Help
    Attached Files

    #2
    Hello Pcomm69,

    Just to clarify, when you add the secondary series, the FirstTickOfBar stops being true on the first tick of primary series?

    This should not be the case. Are you able to demonstrate that the sound does not trigger when a new bar on the chart opens?

    I have tested this on my end with range and renko bars and I am finding that the sound is triggering on both series.

    If you would like to have actions trigger for a particular data series, use BarsInProgress so you know when that series is processing.

    if (BarsInProgress == 0 && FirstTickOfBar)
    {
    PlaySound(@"C:\Program Files (x86)\NinjaTrader 7\sounds\AutoTrail.wav");
    }

    Below is a link to the help guide on BarsInProgress.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      31 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      286 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      283 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      133 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      91 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X