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 AaronKoRn, Today, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      10 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      11 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X