Determining the 'Last' Bar - futures io
futures io futures trading



Determining the 'Last' Bar


Discussion in NinjaTrader

Updated
    1. trending_up 4,766 views
    2. thumb_up 1 thanks given
    3. group 0 followers
    1. forum 4 posts
    2. 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)

 
Search this Thread
 

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
 
srgtroy's Avatar
 
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!

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
OFA (Order Flow Analytics) Licence
NinjaTrader
Automating strategies on multiple charts with same symbol
TradeStation
ZigZag with Depth and Backstep
EasyLanguage Programming
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
 
 
(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
 
Big Mike's Avatar
 
Posts: 49,779 since Jun 2009
Thanks: 32,306 given, 97,566 received


if (Historical)

I think is what you want.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
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
 
srgtroy's Avatar
 
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.

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Legendary Market Wizard
Los Angeles, California Republic
 
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
 
srgtroy's Avatar
 
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!

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Determining the 'Last' Bar


Last Updated on July 11, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts