Swordfish Indicators
Custom Indicator Installation
Updated: 2014/08/25
This Swordfish custom indicator example will show you how to install any custom indicator script with parameters.
The indicator is a sample only and is not intended to be a viable trading system.
It will draw a fast and a slow moving average and will label entries as follows:
- Buy:
- Short:
The fast MA is above the slow MA and closing price crosses the fast MA in an upwards direction.
The fast MA is below the slow MA and closing price crosses the fast MA in a downwards direction.
Audio alerts are also generated.
Line Colours
- The Fast MA line is drawn in blue.
- The Slow MA line is drawn in red.
Two parameters are required to specify the fast and slow moving average periods.
The Swordfish custom indicator sample script can be downloaded here. Follow the detailed instructions below to install this sample indicator or any of the other indicators available. Create the associated parameters exactly as shown lower on this page.
Swordfish Indicator:
CS_Custom.txt Size : 0.713 Kb Type : txt |
|
Create the new Indicator on your Swordfish:
Select any of your current charts or add a new chart. Right click on the chart and then left click Edit/Add Indicator.
Click More.
Expand the Custom folder and then click MyInd0.
Click OK.
The Indicator Manager dialog box will be displayed. You may also have other indicators listed.
Make sure the Custom.MyInd0 is highlighted and click the Source Code button.
The dialog box below will be displayed.
Right click on Custom and then click Add Custom Indicator.
Select CustomIndicator1.
For this example the indicator is named CS_Custom.
Name your new indicator anything you like. Only use alphanumeric characters and underscores. Do not use spaces.
Enter a Full or longer indicator name as well as a detailed Description of the indicator.
Neither fields are required.
Create the parameters:
Repeat these steps for each required parameter. This example uses two indicator parameters.
Other indicator scripts could use many more parameters and some may require none.
This website will usually list the parameters in the table format below. The second column in the table describes the function of the parameter and is not entered in Swordfish.
Name
MAFp
MASp
CS_Custom
Fast MA Periods
Slow MA Periods
Default
10
50
Minimum
1
2
Maximum
100
200
Type
Double
Double
Feel free to change the Default, Minimum and Maximum values to match your preferences where applicable.
Do not amend the parameter Name or Type in any way. The parameter Description field is best left blank.
Right click on the new indicator name. CS_Custom in this example.
Click Add Indicator Parameter.
Enter the parameter details.
Repeat the process for each indicator parameter.
Both parameters for this Swordfish example has been added below.
Paste the indicator script code:
Download the custom indicator you want to create. CS_Custom.txt in this sample installation.
Click on the new indicator name. CS_Custom in this example.
Open the downloaded script file.
Select and copy the code.
Use CTRL-V on your keyboard to paste the code into the Script area.
Click Check Script to compile the indicator.
Look for the OK! to ensure that the script compiled successfully.
If any errors occurred during the compilation process, they will be listed instead of the OK!. In this case you need to retrace your steps to find where you deviated from the instructions.
Click Close.
Click Yes when prompted to save the script.
The Indicator Manager dialog now shows the Main, Custom.MyInd0() and CS_Custom indicators listed as Current Indicators.
Select Custom.MyInd0() and click Delete to remove.
Remove any other indicators or duplicates not required.
Click OK to return to the chart.
The displayed Swordfish chart will now include the newly created custom indicator.
The new custom indicator will also be available to include with other charts when the Select Indicator dialog is displayed.