NinjaScript > Educational Resources > Tutorials > Strategies > Beginner - Simple MA Cross Over >

Set Up

Print this Topic Previous pageReturn to chapter overviewNext page

The first step in creating a custom strategy is to use the custom strategy wizard. The wizard provides two options:

 

Allow you to create a functional strategy without any programming
Generate the required NinjaScript code that will serve as the foundation for your custom strategy for further coding

 

1. Within the NinjaTrader Control Center window select the Tools > New NinjaScript > Strategy... menu

2. Press the "Next >" button

 

Tutorials_Strategies_1

 

3. Enter the information as shown above

4. Press the "Next >" button

 

Defining Input Parameters

Below you will define your strategy's input parameters. These are any input parameters that can be changed by the user when running or backtesting a strategy. If your strategy does not require any parameters leave the "Name" fields blank.

 

Tutorials_Strategies_2

 

5. Add the inputs as per the image above
6. Press the "Next >" button

 

Defining Conditions and Actions

Below you can define conditions that trigger user defined actions such as placing orders, drawing on a chart or creating an alert.

 

Notice how there are two buttons on the screen below:

 

View Code... - Pressing this button loads the strategy code in the NinjaScript Editor for viewing purposes only. This is a great approach if you are new to programming or you want to see how the strategy wizard dynamically generates the correct script code on the fly.

 

Unlock Code - Pressing this button loads the strategy code in the NinjaScript editor for further manual editing. Once this button is pressed, you can NOT go back to the Wizard for strategy construction and editing.

 

Tutorials_Strategies_3

 

If you want to proceed with this tutorial through self programming continue here after pressing the "Unlock Code" button.