Trading Articles
Article Categories
Article Tools
Determining the 'Last' Bar
Updated July 11, 2011
trending_up
4,766 views
thumb_up
1 thanks given
group
0 followers
forum
4 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Determining the 'Last' Bar
(login for full post details)
#1 (permalink )
Legendary Market Wizard
Los Angeles, California Republic
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,936 since Jan 2011
Thanks: 1,375 given,
3,714
received
In ThinkScript, you can use the following statement:
If IsNan(Close[-1]) then 1 else 0;
to determine if the bar being 'processed' is the last one or if there are more bars ahead of it.
I tried to do this in NinjaScript using Double.IsNan(Close[-1]) but it doesn't work. Is there another way to accomplish this objective?
Thanks!
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#3 (permalink )
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,779 since Jun 2009
Thanks: 32,306 given,
97,566
received
if (Historical)
I think is what you want.
Mike
The following user says Thank You to Big Mike for this post:
(login for full post details)
#4 (permalink )
Legendary Market Wizard
Los Angeles, California Republic
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,936 since Jan 2011
Thanks: 1,375 given,
3,714
received
Actually, it was my bad.
The statement does work in NinjaScript, but you have to make sure that you use the if (CurrentBar < n) return;
statement properly first. I'm not used to doing this as it is generally not required in ThinkScript.
(login for full post details)
#5 (permalink )
Legendary Market Wizard
Los Angeles, California Republic
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,936 since Jan 2011
Thanks: 1,375 given,
3,714
received
For the record,
You were 100% correct Big Mike.
At first, I was only testing the indicator containing the statement on daily charts with Kinetick EOD data. Essentially, those are historical only charts. Once I moved to smaller timeframes with real-time bar updates, my charts started going nuts. I added the historical condition and everything suddenly worked nicely.
Thanks again for your reply!
Last Updated on July 11, 2011
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April