NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-29-2009, 08:41 PM   #1
d.allen101
Senior Member
 
Join Date: Jun 2009
Location: Chicago
Posts: 154
Thanks: 0
Thanked 0 times in 0 posts
Default problems with granularity

What am I doing wrong here? Assuming that the primary bar is a daily bar and the secondary bar is a 10 min bar. I'm trying to buy at the next daily open based on signal generated from current daily bar and liquidate if the 10 min bar violates the previous bar's low:

protected override void OnBarUpdate()
{
if(BarsInProgress==0)
{
if(Close[0]>High[1])
{
EnterLong("buy");
}
}

if(BarsInProgress==1)
{
if(Closes[1][0]<Low[0])
{
ExitLong(1,1,"sell","buy");
}
}
}
d.allen101 is offline  
Reply With Quote
 

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
Backtest Granularity tlan294 Strategy Development 2 01-19-2009 07:26 AM
Can you really Backtest NT with an intrabar granularity? calin Strategy Development 1 12-03-2008 08:53 AM
What's the benefit of the intra-bar granularity sample? tradefaz General Programming 7 09-02-2008 09:56 AM
Intrabar granularity eswap0 General Programming 7 06-08-2008 03:10 PM
Why is hour granularity unsupported? henry.omd Miscellaneous Support 1 12-24-2007 09:53 AM


All times are GMT -6. The time now is 03:32 AM.