How to read indata parameters into scripts


When working with a script that will connect to multiple instruments simultaneously, it is often very useful to be able to set different parameters for the input data per individual instruments. Ie, you can use the same script for different instruments but with different input data for each instrument.
For example the script for Stop Loss Mini long that loads the desired trailing level from the field SL Mini trail level. You can find the tab for the input of basic data-dialog that opens, select an instrument in an instrument listing, and click ENTER.


How to use parameters in scripts


To read a parameter in your own script, use script function ScrPar(n) where n represents one of the 32 boxes, numbered 1-32. For example, use the box 18 in a script you can write:

value:=ScrPar(18)

The variable "value" then receives the value entered in box 18.

Name the fields (advanced)


You can name the fields in the dialog as you want. This requires opening and editing the ini-file AutostockTrader.ini which can be found in c:/programdata/autotraderbas (hidden catalog):


[ScriptParameters]

Label01=Flytnivå Stoploss Mini

Label02=Klassisk Stoploss Multi

Label03=Flytande Stoploss Multi

Label04=Larmkod Stoploss Multi

Label05=Trend Entry insats

Label06=TermiATor insats

Label07=M Valley insats

Label08=DynTrend insats

Label09=ditt eget fält 1

Label10=ditt eget fält 2

and so on