RedigeraOrdermodeller
Previous Topic  Next Topic 

How to select scripts and put together an order model


For a more thorough education please refer to the Script reference, Lesson 1:

www.autostock.se/NATscriptref/Lektion1.html


To make a complete sequence in an order model we need script for the basic trigger, amount and price. When these scripts have been finished you can easily put them in an order sequence within an order model. Open the dialog using Settings > Configure order models


A dialog opens where we can create our new order model. Click on New and name your model:



Next step is to create a sequence, a buy sequence for example if we want to buy a stock. Click New in the lower part of the dialog and name your sequence:


Configure the sequence behaviour and select scripts

The new sequence needs to be configured using right click, then select the different options. For example, if orders on the market should be cancelled before a new order is placed. First step is select if the order should be an automatic order (Simulated mode can be used to verify that an order sequence sends the correct values before switching to Auto mode):


We can also decide if the order model should loop back to the beginning after an order has been placed.


The alternative Cancel active > Yes or No decides if an existing active order "on market" should be cancelled before a new order is placed. This is very useful if you have an order model that sends orders some way below the current market price in an attempt to "buy cheap". To avoid having too many orders in the market simultaneously you can select the function Cancel active to first remove any "on market" orders.


Select scripts for the sequence


Select the sequence and click Edit to open the dialog where order type and trigger script can be selected. In this example we selected a script sl) Utbildningsmodell köp 2:


Click Next step to select the remaining scripts:


An extra control script has been selected (Delay order), and the volume amount script "va) 50 000 kr enligt aktuell säljkurs" to calculate how many shares can be bought for 50 000 kr. Finally, the price script vl) Aktuell säljkurs defines what price we want to place the order at, in this case market ask price.

As the sequence is now finished, click on Save sequence. Also remember to click Save in the main order dialog, otherwise the model will not be saved at all.

När sekvensen (eller sekvenserna) är färdigkonfgifurerade och sparade måste hela ordermodellen sparas i sin helhet. 

Tips: Whenever you make changes to an order model it will need to be re-connected to its instruments in order for the changes to take place.