Operations > Strategy Wizard >

Strategy Actions

Print this Topic Previous pageReturn to chapter overviewNext page

The Strategy Action window allows you to select actions to execute.

 

tog_minusUnderstanding the Strategy Action window

Strategy Action Window

The Strategy Action window allows you to select actions to execute. Actions are executed when a strategy condition is true. The Strategy Action window can be accessed via the Conditions and Actions wizard screen or the right mouse button click menu of the NinjaScript Editor.

 

Within a NinjaScript strategy you can invoke miscellaneous actions, submit various order types for entering and exiting market positions, and have access to various drawing methods as shown in the images below.

 

Strategy_Wizard_21

tog_minusHow to enter a market position

Entering a Market Position

Using the various Order management actions, you can enter a position using market, limit, stop market and stop limit orders.

 

Following is an example and represents one of many possible combinations.

 

1. Expand the Order management category and select Enter a long position by a limit order

2. You can set the number of contracts/shares for the order or leave the DefaultQuantity value which allows you set the quantity when starting a strategy

3. Set the *Signal name property to any user defined value to identify the entry (you can also leave this name blank)

4. We can set the limit price dynamically by setting it to another item's value, press the "..." button to open the Value window

 

Strategy_Wizard_22

 

*Signal names are important in that they are used as unique identifiers if you have more than one unique entry in a strategy. By providing unique entry signal names for each entry on a strategy, you can then identify which position you want closed via the exit position methods. Signals names are also used to identify executions on a chart.

 

5. Expand the Price data category and select Bid

6. Set the Offset type to Ticks and enter a value of "-1" for Offset (see "How to offset an item value" section of the Condition Builder page of the Help Guide for more information)

 

Strategy_Wizard_23

 

Once the OK button is pressed, an action is created that would translate to the following:

 

"Enter a buy limit order at a price 1 tick below the current bid price to enter a long position"

tog_minusHow to exit a market position

Exiting a Market Position

Using the various Order management actions, you can exit a position using market, limit, stop market and stop limit orders.

 

Following is an an example and represents one of many possible combinations.

 

1. Expand the Order management category and select Exit long position (exits via market order)

2. Set the Signal name property to any user defined value to identify the entry (you can also leave this name blank)

3. Set the From entry signal property to a named entry signal within the strategy. Providing a value will exit only the quantity associated to the position created by the named signal. Leaving it blank will exit the total net position.

 

Strategy_Wizard_24

 

Once the OK button is pressed, an action is created that would translate to the following:

 

"Enter a sell market order to exit from entry signal 'Long Entry'."

tog_minusHow to draw on a chart

Drawing on a Chart

Using the various Drawing methods, you can draw lines, text, squares and more on a chart. You can review detailed information on supported drawing methods in the NinjaScript Language Reference section of this Help Guide.

 

Following is an an example and represents one of many possible combinations.

 

1. Expand the Drawing category and select Diamond

2. Set the Tag parameter with a user defined name that identifies this drawing object. Providing a tag is of value if you are going to draw more than one of the same draw type object (Diamond in this case) on the same bar.

3. Optionally set Auto Scale to "True" to include the Diamond as part of the chart's auto scaling.

4. Set the Bars ago parameter to "0" which will draw the diamond on the current bar x location

5. Set the Y parameter to the "High" of the current bar plus one tick by pressing the "..." button to display the Value window

6. Set the Color parameter to any user defined color

 

Strategy_Wizard_25

 

Once the OK button is pressed, an action is created that would translate to the following:

 

"Draw a red diamond above the high of the current bar plus one tick"