NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 07-02-2008, 09:13 AM   #1
palinuro
Senior Member
 
Join Date: Dec 2007
Posts: 115
Thanks: 2
Thanked 0 times in 0 posts
Default Historical and first bar of current session

Hi,

Code following " if (Historical) " is executed on the first tick of the first bar of the current live session. Is there a way to prevent this?

Thanks
palinuro is offline  
Reply With Quote
Old 07-02-2008, 09:25 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

To clarify.

if (Historical)
Print("Something");

You are saying that on the 1st tick of real-time bar, this code executes? If yes, how do you know that it is real-time?
NinjaTrader_Ray is offline  
Reply With Quote
Old 07-02-2008, 09:37 AM   #3
palinuro
Senior Member
 
Join Date: Dec 2007
Posts: 115
Thanks: 2
Thanked 0 times in 0 posts
Default

Yes. I open the chart before the session starts. The code is executed on the historical bars (which is what I want and would expect).

Then when the session starts, the code executes on the first tick of the new bar. I print out the time, price, volume, etc., so I know it's the first bar of today's session.
palinuro is offline  
Reply With Quote
Old 07-02-2008, 11:55 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Thanks again. This is confirmed and we will resolve this for NT7 at this time.
NinjaTrader_Ray 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
Fill to Current Bar argito Strategy Analyzer 3 05-26-2008 07:51 AM
Current Bid >= Last Fill + (0.5 x ATR) davidfw1866 Strategy Development 4 11-28-2007 07:45 AM
Session Begins -- Session Ends bmaltz Charting 6 11-11-2007 11:45 PM
Changing Session Begins and Session Ends time forexample Charting 1 10-21-2007 01:16 AM
How to plot an indicator only on the current session max1ci6 Indicator Development 2 04-24-2007 07:50 PM


All times are GMT -6. The time now is 09:49 PM.