NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 07-15-2009, 04:24 AM   #1
saltminer
Senior Member
 
Join Date: Apr 2008
Posts: 164
Thanks: 2
Thanked 3 times in 3 posts
Default Closes[1][-1]

Hi guys,
I've just noticed that Closes[1][-1] works just fine in Historical, returning the true closing price for a barsarray that has not yet experienced its OnBarUpdate().
For example, in BarsInProgress==0, Closes[1][0] actually returns the value of the bar before the current one in BarsInProgress==0. This is documented and expected.
Yet Closes[1][-1] works just great! Yahoo! I wish I had known that several thousand lines of code ago.

My question is - is it safe to use?

Thanks,
saltminer
saltminer is offline  
Reply With Quote
Old 07-15-2009, 05:01 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> My question is - is it safe to use?
No it's not. It's definitely outside the specifications and thus may or may not work.
NinjaTrader_Dierk is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order exiting at market after bar closes rscowboy1 Strategy Development 2 05-13-2009 01:33 PM
IB Auto closes at Night market_student Connecting 3 03-25-2009 02:43 PM
ATM strategies execute after market closes?? bridenour ATM Strategies (Discretionary Trading) 4 01-21-2009 04:56 PM
No money going in Realized P&L when trade closes jlm0@infionline.net Historical NinjaTrader 6.5 Beta Threads 12 11-12-2007 07:01 AM
Strategies stop after position closes ashish Automated Trading 3 11-04-2007 01:24 AM


All times are GMT -6. The time now is 01:11 AM.