Skip to main content
Skip table of contents

Constructors (trading systems)

Security.TradingSystem[Lines;Long;Short;CloseLong;CloseShort;SignalMode;Include_Short_Sells;Spreads;Limit;Interest;Rates;Delay;Slippage]→TradingSystem

Lines (time series): Lines to be displayed in the chart.

Long, Short, CloseLong, CloseShort (time series): Signal specification (depending on signal mode).

SignalMode (number: 1, 2 or 4 [4]): Interpretation mode for the signal time series.

Include_short_sales (Boolean[True]): Specification for the performance evaluation.

Expenses (percentage [0]): Specification for the performance evaluation.

Limit (number | function): Specification for the performance evaluation.

Interest (percentage [0]).

Prices (time series [Close]).

Delay (number[1]).

Slippage (percentage [0]): Data for performance evaluation.

Result: The TradingSystem function returns the trading system on the security specified by the parameters. (See the chapter Trading systems.)


To Limits:

To define a limit scheme, a function (an anonymous macro) is transferred with the <Limit> parameter, which is to make the decision on a limit exit for a trading position.

This function has the parameters:

Security: the evaluated security.

Long (Boolean): Indicates whether the position is long ("True") or short ("False").

EntryPrice (numberWithTime): Entry price and date (i.e. the price of the security on the day following the signal).

CurrentPrice (ZahlMitZeit): current exit price with date.

The function should return a Boolean as the result, "True" means "Limit exit". The limit function is evaluated from the entry point of a trading phase for each subsequent price (on a daily basis) until it returns "True" (or other signals end the trading phase).

Beispiel 1

#$[$Long;$EntryPrice;$CurrentPrice](
if($Long;
$CurrentPrice<$EntryPrice*(1-$Losslimit);
$CurrentPrice>$EntryPrice*(1+$Losslimit))
)

This function tests whether the price has fallen below the entry price minus a configurable percentage ($LossLimit) (nontrailing loss). The evaluation must be mirrored for short positions.


Beispiel 2

$TrailEntry:= -1;
$LimitFunction:=
#[$Long;$EntryPrice;$CurrentPrice](
$TrailEntry:=if($TrailEntry<0;$EntryPrice;$TrailEntry);
$TrailEntry:=if($Long;
Max($TrailEntry;$CurrentPrice);
Min($TrailEntry;$CurrentPrice));
if($Long;
$CurrentPrice<$TrailEntry*(1-$Losslimit);
$CurrentPrice>$TrailEntry*(1+$Losslimit))
)

This is a simulation of the trailing loss using a limit function. In the variable $TrailEntry, the entry price is updated and adjusted according to the current prices during the limit evaluation.

Please also read the chapter Trading systems.

Security.tradingSystemReference[Name:String]→TradingSystem

Result: The TradingSystemReference function returns the trading system defined by the trading system folder for the security specified by<name>. This function is primarily used to display trading systems in a chart that are given by Explorer objects.


Time series.HSBandBreakdownOutside[Band;Tolerance]→Trading system

Result: The HSBandBreakoutmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


Time series.HSBandBreakdowninside[Band;Tolerance]→Trading system

Result: The HSBandBreakdownmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


TimeSeries.HSBandComparison[Band;Comparison_period;Tolerance]→Trading system

Result: The macro HSBand comparison, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


Time_series.HSGD_Comparison[VglGD_period;VglGD_method;Comparison_period;Tolerance]→Trading_system

Result: The macro HSGD comparison, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


TimeSeries.HSLineComparison[center_line;comparison_period;tolerance]→trading_system

Result: The macro HSLineComparison, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


TimeSeries.HSLineComparisonZr[Line;Comparison_period;Tolerance]→Trading_system

Result: The HSZweiLinienVergleichmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


Time_series.HSMultilineCrossing[Comparison_period;Tolerance]→Trading_system

Result: The HSZweiLinienVergleichmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


Time series.HSReversal[midpoint line]→Trading system

Result: The HSReversalmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


TimeSeries.HSTwoLinesComparison[Top;Bottom;Comparison_period;Tolerance]→Trading system

Result: The HSZweiLinienVergleichmacro, which builds a corresponding trading system from an indicator line. For the meaning, see the macro definition.


Security.SignalSystemReference[Name:String]→Trading system

Result: The SignalSystemReference function returns the trading system defined by the signal system folder for the security specified by<name>. This function is primarily used to display trading systems in a chart, which are given by signal system folders in the Explorer.



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.