![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Mar 2009
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Total newbie here, to both NT and C#. Trying to test a simple strategy to ensure I understand the concepts. Just want it to draw a dot when the condition is met. I bring up a daily chart using a Yahoo connection, apply the strategy. Doesn't seem to be working. Thanks for help.
ps....wish you ran more "Intro to Ninjascript" online classes. Hard to come by. #region Using declarations using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Indicator; using NinjaTrader.Gui.Chart; using NinjaTrader.Strategy; #endregion // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { ///<summary> /// Indicates Three Lower Closes ///</summary> [Description("Indicates Three Lower Closes")] publicclass ThreeLowerClosesTest : Strategy { #region Variables // Wizard generated variables // 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] < Close[1] && Close[1] < Close[2] && Close[2] < Close[3]) { DrawDot("My dot" + CurrentBar, false, 0, 0, Color.Blue); } } #region Properties #endregion } } #region Wizard settings, neither change nor remove |
|
|
|
|
|
#2 | |
|
Certified NinjaScript Consultant
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Testing a strategy against indices | SuperDriveGuy | Strategy Analyzer | 4 | 03-18-2009 02:10 PM |
| Strategy Testing | kipper | Strategy Development | 1 | 01-07-2009 05:59 AM |
| Testing Stochastic with Strategy Analyzer | ek1688 | Strategy Analyzer | 6 | 01-05-2009 06:47 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 |