Webinar: Learning How to Write NinjaTrader Indicators and Strategies NinjaLaunchPad.com

Webinar:
Learning How to Write NinjaTrader
Indicators and Strategies
NinjaLaunchPad.com
[email protected]
Scott Daggett presenting
Topic Outline
2
 What knowledge is required?
 Minimal C#.NET language and .NET framework
 Intro to the NinjaScript code editor
 Knowledge needed to write NinjaTrader indicators
 Knowledge needed to write NinjaTrader strategies
 How to obtain the needed knowledge and experience
10/9/2012
What Knowledge is Required?
3
 Trading/Trading Platform
 Technical Analysis; price and volume concepts
 Charting/Chart
types (bar, candle, range; tick, time, volume, etc.)
 Indicators—what they are, how they are used
 Automation strategy concepts—if you’re programming them

Trade execution and mgmt concepts (for auto. strategies)
 Order

types, Time in Force, bracket orders, etc.
NinjaTrader trading platform
 C#.NET Programming with some .NET Framework
 NinjaScript (environment, classes, methods, etc.)
 Debugging and testing concepts and methods
10/9/2012
C#.NET Language & Framework References
4
 C#.NET Language (http://msdn.microsoft.com/en-us/library/default.aspx)
 MSDN Library > Development Tools and Languages > Visual
Studio.NET > Visual Basic and Visual C# > Reference > Visual
C# Language
>
C# Language Tour
 > C# Programmer’s Reference

See C# book recommendations at:
http://ninjalaunchpad.com/references
 .NET Framework (http://msdn.microsoft.com/en-us/library/default.aspx)
 MSDN Library > .NET Development > .NET Framework 3.5
 (Check

your version of NT for supported framework version)
See C# book references
10/9/2012
Minimal C#.NET Language
5
 Object oriented programming principles as
implemented in C#.NET

Objects and classes, inheritance, polymorphism, scope,
properties, constructors, destructors, namespaces, etc.
 C# language constructs
 Variables, variable types, flow-of-control (if-then-else; switch;
loops), logical operators, try-catch-finally blocks, exceptions,
structs, enums, functions/methods, using statements, etc.
 Event-driven, multi-threaded programming (typical
in a graphical user interface; includes market datadriven events)
10/9/2012
Minimal C#.NET Framework
6
You
DON’T
need to
know it
all!
10/9/2012
Minimal C#.NET Framework
7
 Key Namespaces & Classes





System
 Array, {data type related, like Boolean}, DateTime, TimeSpan, Enum,
Environment, EventArgs, Exception, Math, String
System.Collections & System.Collections.Generic
 ArrayList, HashTable, IEnumerable, Dictionary, HashSet, List, Queue,
Stack
 (Also the XXXSeries classes in NinjaTrader, like DataSeries)
System.IO
 Directory, File, Path
System.Windows.Forms
 MessageBox
System.Drawing
 Font
10/9/2012
Intro to the NinjaScript Code Editor
8
 Control Center > Tools > New/Edit NinjaScript >
Indicator…/Strategy…
 New Indicator/Strategy Wizards

For starting afresh
 NinjaScript Editor




Color coding
Use of regions
Tool bar features:
 Find & Replace
 Compile
 Outdent / Indent
 Comment / Uncomment
Intellisense / Code Completion
10/9/2012
Knowledge Needed for NinjaTrader Indicators
9
 Creating Indicators —Wizard > Modify Code
 Key Concept - Where's the Data?
 User Settings (Properties)
 Making Sure Data is There Before You Use It
 Input Series and the Input Keyword
 Value Series and the Value and Values Keywords
 Drawing Text and Images on a Chart
 Creating Custom Methods and External Assemblies
(optional)
 Multiple Timeframes and Multiple Instruments
10/9/2012
Knowledge Needed for NinjaTrader Strategies
10
 Everything Needed for Indicators PLUS:
 NinjaTrader’s Trade Management Options for Automation
Strategies
 Managed
(easiest; best for newbies)
 Advanced Managed (still easy, but more flexible w/greater control)
 Advanced Trade Management (ATM) Strategies (give the strategy
user the most automated control over position management)
 Unmanaged (for the masochists among us)

Operational Characteristics of Automation Strategies
 Various
configuration settings and how they impact working
strategies
 Impact of characteristics on design (no fill-or-kill option, for
example, but partial fill is handled for you)

More Advanced Debugging and Testing Skills
10/9/2012
How to Obtain the Needed Knowledge
11
 C# and .NET Framework
 References already provided on slide 4 (MSDN and books)
 UDemy.com and other video-based instruction sites
 NinjaScript Programming
 NinjaTrader’s Help file and Support forum
 NinjaScript Programmer’s Launch Pad eBook
 Big Mike’s trading forum, NinjaTrader Programming section
 NinjaScript training services (do a web search)
 Trading
 See ninjalaunchpad.com/references .html for my opinion
10/9/2012
Special Offer: FREE EBook!
12
1.
2.
3.
4.
5.
Go to www.ninjalaunchpad.com and if you liked this webinar and
the information on the site, Like it in Facebook and +1 in Google
Plus (buttons provided on the site).
Follow ninjalaunchpad on Twitter for future announcements, if
you wish; there’s a link on the site for that.
Send an email TODAY to [email protected] with
“October 2012 NinjaTrader Webinar FREE eBook offer” in the
subject line. (Request this presentation file if you want it, too.)
You must send the email today.
When you get the return email, follow the link to
Smashwords.com and use the provided coupon to get the
NinjaScript Programmer’s Launch Pad eBook for FREE! Coupon
expires in a few days. Your free book includes free upgrades to all
future editions. You will also receive notices of future educational
products and services from me.
Learn to write your own NinjaTrader Indicators and Strategies!
Thank You!
10/9/2012