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 01-06-2009, 06:40 PM   #1
kipper
Junior Member
 
Join Date: Jul 2008
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy Testing

Can someone tell me if a stategy still works OK on a market replay chart and do you need all the indicators on the chart that you have built into the strategy?

Also can someone please have a look at this strategy and tell me why it wont work, it is my first time at arranging a strategy.
#region Variables
// Wizard generated variables
privateint mA10 = 10; // Default setting for MA10
// User defined variables (add any user defined variables below)
#endregion
///<summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
///</summary>
protectedoverridevoid Initialize()
{
CalculateOnBarClose =
true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (Close[0] > EMA(10)[0]
&& CrossAbove(Stochastics(
10, 3, 2).K, Stochastics(10, 3, 2).D, 1)
&& CrossAbove(MACD(
12, 26, 3), MACD(12, 26, 3).Avg, 1))
{
DrawArrowUp(
"My up arrow" + CurrentBar, false, 0, 0, Color.Lime);
EnterLong(DefaultQuantity,
"");
}
// Condition set 2
if (Close[0] < EMA(10)[0]
&& CrossBelow(Stochastics(
10, 3, 2).K, Stochastics(10, 3, 2).D, 1)
&& CrossBelow(MACD(
12, 26, 3), MACD(12, 26, 3).Avg, 1))
{
DrawArrowDown(
"My down arrow" + CurrentBar, false, 0, 0, Color.Red);
EnterShort(DefaultQuantity,
"");
}
}
Last edited by kipper; 01-07-2009 at 02:21 AM.
kipper is offline  
Reply With Quote
Old 01-07-2009, 05:59 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

Hi kipper, congrats on the first strategy - you will want to check the Control Center logs for errors. If there are no errors your conditions are probably just not evaluating to true all at the exact same time.

Yes, the strategies do work in Market Replay mode, you don't have to add the indicators, but it makes the trading signal accuracy check much easier...for a tip how to plot them from the strategy - http://www.ninjatrader-support2.com/...ead.php?t=3228
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
Back Testing Strategy - Drawings Don't Show Ranger Strategy Analyzer 6 03-12-2009 10:08 AM
Testing Stochastic with Strategy Analyzer ek1688 Strategy Analyzer 6 01-05-2009 06:47 AM
inserting a timeframe and testing the wizard strategy jadder486 General Programming 1 12-12-2008 04:36 AM
Testing the same strategy on a continuous future pablo_lasuncion Strategy Analyzer 9 10-17-2008 04:17 PM
forward testing a strategy miketpcc2 Strategy Analyzer 1 08-18-2008 09:36 AM


All times are GMT -6. The time now is 11:15 PM.