NexusFi: Find Your Edge


Home Menu

 





Historical / Last Bar


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one ZARk with 3 posts (1 thanks)
    2. looks_two SammyD with 1 posts (2 thanks)
    3. looks_3 titanus2 with 1 posts (0 thanks)
    4. looks_4 Turbosteve with 1 posts (0 thanks)
    1. trending_up 4,547 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
ZARk
Waterloo
 
Posts: 9 since Aug 2009
Thanks Given: 1
Thanks Received: 1

Hello

I am looking for a TS Equivalent to NinjaTrader's Historical property, or even the LastBar equivalent.

Basically I need to know if the bar is getting it's data from the database, or if it's a "live" bar.

I looked around, but couldn't get anything that would give me the amount of bars present ( which i could compare with currentBar and thus know if i'm running on the lastBar of the chat).


I'm starting to think the only solution would be to start comparing the RealTime with the Bar Time and the barInterval, and determine if the bar took less than barInterval time to run which would mean it's running from database and not live ... but this seems a bit too subjective .... .

Any ideas ?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
Orban Crashes to 21pct on Record Turnout -- McIlroy Drop …
Prediction Markets & Event Contracts
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #2 (permalink)
 SammyD 
Salt Lake City, Utah
 
Experience: Intermediate
Platform: NinjaTrader, Tradestation
Trading: Forex
Posts: 72 since Feb 2011
Thanks Given: 274
Thanks Received: 36

Perhaps you are looking for the function "lastbaronchart"


Reply With Quote
Thanked by:
  #3 (permalink)
ZARk
Waterloo
 
Posts: 9 since Aug 2009
Thanks Given: 1
Thanks Received: 1



SammyD View Post
Perhaps you are looking for the function "lastbaronchart"


I feel like an idiot now .... Why on earth does that function not appear in the help when you type "lastbar" .. i don't know ..

Works like a charm ! Thanks m8 !


Reply With Quote
  #4 (permalink)
ZARk
Waterloo
 
Posts: 9 since Aug 2009
Thanks Given: 1
Thanks Received: 1

Actually i found even better !


GetAppInfo(aiRealTimeCalc);

which is the equivalent to "Historical" in NT

returns 0 if the bar is "backtested" and 1 if it's live


Reply With Quote
Thanked by:
  #5 (permalink)
 Turbosteve 
Sydney Nsw Australia
 
Experience: Intermediate
Platform: Amibroker, Multicharts
Broker: I.B, CQG
Trading: NQ, 6E, SPI
Posts: 18 since Jun 2012
Thanks Given: 50
Thanks Received: 8

Thanks a lot.

I have been using Multicharts for 3 weeks and wanted to draw a trendline for the trailing stop and initial stops on the last bar. I spent 2 hours trying to find a solution before looking here and finding the answer in 2 minutes.

Love Multicharts, but the help is pretty ordinary.


Reply With Quote
  #6 (permalink)
 titanus2 
Tbilisi + Georgia
 
Experience: None
Trading: EUR/USD
Posts: 36 since Aug 2014
Thanks Given: 9
Thanks Received: 20

some of solutions, to detect bar's date and positions...

 
Code
BarInterval   						[returns 5 for 5minute chart and etc...]
value1= FindBar(1050510, 1030); 	[returns bar using the specific date and time]
lastbaronchart  					[returns TRUE or FALSE]    					//p.s. same as GetAppInfo(aiRealTimeCalc)
GetAppInfo(aiSpaceToRight)			[returns bars after last rightmost bar]		//p.s. MaxBarsForward ???


ELDateToString(CurrentDate)	[returns 01/27/2015]
LastCalcTime				[returns 2350 	(it's 23:50)]
LastCalcDate				[returns 960226	(it's 02/26/96)]

Plot2(elsystem.Datetime.CurrentTime.Format("%I:%M:%S, %p"));


Reply With Quote




Last Updated on January 12, 2015


© 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