NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 08-26-2010, 05:38 AM   #1
nt2010
Member
 
Join Date: Jun 2010
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
Default nBarsUp/nBarsDown / maximum x bars

Hello,

i have a question regarding a strategy build.

I want to go short with an break of every 5 minute bar as long we had not more than e.g. 2 upcandles in the selected time frame for the day.
How can i do this ?

with nBarsUP/down i look for a "minimum" of x up or down bars.
Can i also set the condition somehow to work as "maximum" ?

thank you for your support
nt2010 is offline  
Reply With Quote
Old 08-26-2010, 06:05 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

nt2010, I believe you can work with CountIf to test for this occurence during your time periods of the day - http://www.ninjatrader-support.com/H...6/CountIf.html
Last edited by NinjaTrader_Bertrand; 08-26-2010 at 12:12 PM.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-26-2010, 12:09 PM   #3
nt2010
Member
 
Join Date: Jun 2010
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand, thank you for this great hint. This was exactly what i was looking for.

nt2010
nt2010 is offline  
Reply With Quote
Old 08-26-2010, 12:13 PM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

You're welcome, great that helped you realize your task.
NinjaTrader_Bertrand 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
Maximum Bars Look Back + Comparisons MicroTrends Version 7 Beta General Questions & Bug Reports 6 05-20-2010 05:55 PM
Maximum Bars Lookback rt-trader Version 7 Beta General Questions & Bug Reports 19 04-06-2010 02:54 AM
NBarsDown/NBarsUp question mailro Charting 1 03-14-2010 11:12 AM
Maximum Bars Lookback zweistein Version 7 Beta General Questions & Bug Reports 9 12-15-2009 05:36 AM
NBarsDown/NBarsUp question ct General Programming 2 05-30-2007 07:03 AM


All times are GMT -6. The time now is 12:10 PM.