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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      561 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      325 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X