NexusFi: Find Your Edge


Home Menu

 





Bug with FirstTick of Bar


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one pcomm69 with 2 posts (1 thanks)
    2. looks_two odmassion with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 ratfink with 1 posts (1 thanks)
    1. trending_up 2,075 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
pcomm69's Avatar
 pcomm69 
paris france
 
Experience: Advanced
Platform: NinjaTrader
Broker: Continuum
Trading: gold & crude light
Posts: 55 since Oct 2011
Thanks Given: 14
Thanks Received: 4

Hi,

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


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,550 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,430



pcomm69 View Post
Hi,

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

Check the BarsInProgress variable, 0 for main series, higher for added series.


Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
pcomm69's Avatar
 pcomm69 
paris france
 
Experience: Advanced
Platform: NinjaTrader
Broker: Continuum
Trading: gold & crude light
Posts: 55 since Oct 2011
Thanks Given: 14
Thanks Received: 4

Thanks Ratfink

For everybody the typical answer is :
if (BarsInProgress == 0 && FirstTickOfBar) "serie of chart"
{}
if (BarsInProgress == 1 && FirstTickOfBar) "add serie 1"
{}
etc.....


Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 odmassion 
new york United states
 
Experience: Intermediate
Platform: Ninja Trader
Trading: Emini Es
Posts: 124 since Aug 2016
Thanks Given: 18
Thanks Received: 13


pcomm69 View Post
Thanks Ratfink

For everybody the typical answer is :
if (BarsInProgress == 0 && FirstTickOfBar) "serie of chart"
{}
if (BarsInProgress == 1 && FirstTickOfBar) "add serie 1"
{}
etc.....


Hello everyone,
how do i create a strategy or an indicator that triggers an arrow on the first tick of a bar?


Reply With Quote
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


odmassion View Post
Hello everyone,
how do i create a strategy or an indicator that triggers an arrow on the first tick of a bar?

Check the first post, it's simply:
if (FirstTickOfBar) {
do your stuff...
...}


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
  #7 (permalink)
 odmassion 
new york United states
 
Experience: Intermediate
Platform: Ninja Trader
Trading: Emini Es
Posts: 124 since Aug 2016
Thanks Given: 18
Thanks Received: 13


sam028 View Post
Check the first post, it's simply:
if (FirstTickOfBar) {
do your stuff...
...}

Hi, Thanks for your replay. Am not a programmer, so i really don't know how to modify indicators. can you please help me
modify following indicator to paint an arrow in the first tick of the opening bar once the bar changes color? blue arrow for up and red arrow for down.


zip.gif ReversalBar_V2.zip (5.4 KB)


Attached Files
Elite Membership required to download: ReversalBar_V2.zip
Reply With Quote




Last Updated on January 28, 2017


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts