Useful information for more advanced NinjaTrader users!

This information was taken from the NinjaTrader forum https://ninjatrader.com/support/forum/forum/ninjatrader-8/indicator-development/97575-sample-scripts#post786040
NinjaScript is written in C# 5 targeting .NET 4.8.

If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started.

In the help guide there are language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.

The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

This is a powerful tool. The best way to be introduced, would be to follow along with our ‘Automate Your Trading with NinjaTrader’s Strategy Builder’ tutorial which shows you how the tool can be used to create a simple strategy that can then be tested.

I recommend starting here, and then to start making simple strategies just to test out one or two conditions so you can be sure that you have the conditions set up appropriately. It is important to start small and to test as you go to ensure that the logic is working before you scale up and add more complexity to the strategy.

I’m providing a link to the ‘Automate Your Trading with NinjaTrader’s Strategy Builder’ training for you to view at your own convenience.
Automate Your Trading with NinjaTrader’s Strategy Builder – https://www.youtube.com/watch?v=VxU4…We0Nf&index=11

As well as links to the help guide with example conditions that can be setup in the Strategy Builder.
Conditions examples
https://ninjatrader.com/support/help…on_builder.htm
Actions examples — https://ninjatrader.com/support/help…us/actions.htm

For diving further into the C# code of an unlocked strategy or indicator, the NinjaScript Editor 401 is an overview of the syntax and debugging.
NinjaScript Editor 401 – https://www.youtube.com/watch?v=H7aD…ZmVnauWXkWe0Nf

Next up is a link to a set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide:
http://ninjatrader.com/support/helpG…on_builder.htm

The entire Alphabetical Reference can be found with the following link:
http://ninjatrader.com/support/helpG…_reference.htm

Below are links to Reference Samples online as well as some Tips and Tricks for both indicators and strategies. These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

Click here to see our NinjaScript Reference Samples:
https://ninjatrader.com/support/help…ce_samples.htm

Click here to see our NinjaScript Tips:
https://ninjatrader.com/support/helpGuides/nt8/tips.htm

I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
http://ninjatrader.com/support/helpG…_resources.htm

All links to 3rd party educational resources below are publicly available.

If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
http://ninjatrader.com/support/helpG…g_concepts.htm

And the MSDN (Microsft Developers Network) C# Language Reference.
https://ninjatrader.com/support/help…_reference.htm

I have personally found DotNetPerls to be a very helpful 3rd party educational resource with simple, direct, and easy to follow examples.
https://www.dotnetperls.com/

There is a also a growing library of community submitted custom indicators (200+) that can be downloaded from our forum. Please look in the NinjaScript File Sharing section of our support forum as you may find what you are looking for there.
https://ninjatraderecosystem.com/user-app-share/

Use the Intelliprompt to see how methods can be called (Ctrl + Space to view overload signatures) and what properties are available to an object.
https://ninjatrader.com/support/help…elliprompt.htm

Last, I’m also sharing a link to another forum post that reviews how to use prints to understand behavior and debug a script when the behavior is unexpected.
http://ninjatrader.com/support/forum…979#post510979

Other useful resources on learning C#:
NinjaScript Debugging
Dot Net Perls
W3Schools
Softsteel Soluions
CSharp Essentials
C# Station
The Code Project
Channel 9 C# Fundamentals
Pluralsight