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 07-24-2012, 08:47 PM   #16
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

Does the strategy make any trades at all ?

Code:
 
// Condition set 1
if (CrossAbove(T3(MyInput0, 3, 0.7), T3(MyInput1, 3, 0.7), 1)
&& Close[0] < Bollinger(2, MyInput2).Lower[0])
{
EnterLong(DefaultQuantity, "");
}
After looking more into your code it seems very unlikely that the condition for a long entry will ever occur because you have a relative long period T3 crossover and a relatively fast Bollinger setting.
If the T3 crossover occurs, there's a strong uptrend and Close[0] will in most cases be in -or- above the upper range of the Bollingerbands, and not below the lower band.

Therefore I suggest you increase the CrossAbove lookback period to 10 or more depending on your timeframe settings.
That way, if a crossover occurs, the code will look if Close[0] goes below the lower BollingerBand for the next 10 bars, and not only at exactly the time (ie. the same bar) the crossover occurs.

like this:

Code:
 
if (CrossAbove(T3(MyInput0, 3, 0.7), T3(MyInput1, 3, 0.7), 10)
&& Close[0] < Bollinger(2, MyInput2).Lower[0])
{
EnterLong(DefaultQuantity, "");
}
marcow 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
Help with basic SMA Crossover strategy kemosabe Automated Trading 9 04-26-2012 12:48 PM
basic strategy wizard features anniebee Suggestions And Feedback 1 07-11-2010 09:30 AM
Combining Basic Halt strategy with another strategy? Ninja B Automated Trading 1 07-18-2008 01:11 AM
Basic TRIN strategy alfie Strategy Development 4 05-11-2008 06:32 AM
basic help on program a strategy z32000 Strategy Development 10 11-23-2007 07:59 PM


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