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 Turbosteve with 1 posts (0 thanks)
    3. looks_3 SammyD with 1 posts (2 thanks)
    4. looks_4 selnomeria with 1 posts (0 thanks)
    1. trending_up 3,795 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Historical / Last Bar

  #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?
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
19 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 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)
 selnomeria 
Tbilisi + Georgia
 
Experience: None
Platform: ThinkScript,Tradestation
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"));

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on January 12, 2015


© 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