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 1,564 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

Bug with FirstTick of Bar

  #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?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



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: 117 since Aug 2016
Thanks Given: 18
Thanks Received: 11


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,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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 Twitter Reply With Quote
  #7 (permalink)
 odmassion 
new york United states
 
Experience: Intermediate
Platform: Ninja Trader
Trading: Emini Es
Posts: 117 since Aug 2016
Thanks Given: 18
Thanks Received: 11


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts