Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 DayTradingDEMON, Today, 09:28 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      8 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by helpwanted, Today, 03:06 AM
      2 responses
      22 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by navyguy06, Today, 09:28 AM
      0 responses
      5 views
      0 likes
      Last Post navyguy06  
      Started by rjbtrade1, 11-30-2023, 04:38 PM
      2 responses
      77 views
      0 likes
      Last Post DavidHP
      by DavidHP
       
      Working...
      X