![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2008
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |