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 > Strategy Development

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

Reply
 
Thread Tools Display Modes
Old 04-29-2009, 06:38 AM   #1
junkone
Senior Member
 
Join Date: Sep 2008
Posts: 356
Thanks: 1
Thanked 1 time in 1 post
Default why does not Bars.FirstBarOfSession not fired

protectedoverridevoid OnBarUpdate()
{
if (Historical){
Print(
"in historical");
return;
}

if(Bars.FirstBarOfSession )
{
Print(
"in FirstTickOfstrategy");
}

the FirstTickOfstrategy is not getting fired.
junkone is offline  
Reply With Quote
Old 04-29-2009, 06:58 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 981 times in 963 posts
Default

Hi junkone, which chart session time have you defined? Please make sure to enable the strategy before the first bar of the session starts building.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 04-29-2009, 09:33 AM   #3
junkone
Senior Member
 
Join Date: Sep 2008
Posts: 356
Thanks: 1
Thanked 1 time in 1 post
Default

how do you define session?
1. on connection with IB
2. when chart loads up with ib session
3. when the stretegy starts
junkone is offline  
Reply With Quote
Old 04-29-2009, 09:42 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Double click on your chart and you define your session there. Any strategy thrown onto that chart will use the chart session you have defined.
NinjaTrader_Josh 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
ExitShortStop fired again xewoox Automated Trading 9 02-17-2009 11:18 AM
Bars.FirstBarOfSession not set to true during backtest? tradefaz General Programming 1 09-03-2008 08:19 AM
Bars.FirstBarOfSession opening price 1 min vs 1000 volume charts ATI user Charting 4 06-10-2008 06:40 AM
Question about FirstBarOfSession lucktrader General Programming 1 05-10-2008 02:32 PM
multiple (unwanted) orders fired on 'outside' bars roxana Automated Trading 1 05-25-2007 11:13 AM


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