How Can We Help?

SIGNALS Function

You are here:
< All Topics

The SIGNALS script will allow the back tester to know which variable to use as a buy and sell signal.
The syntax is as follows:

SIGNALS(buy_signal, sell_signal)
// NOTE: The buy and sell arguments can be any variable that you declare. To show an example, we’ll be using breakout and breakdown as the buy and sell signals below.

First check if your script already has a buy and sell variable. If your script already has a declared buy and sell signal, all you need to do is add the following script below for the back testing module to recognize the trading signals. You have to put the SIGNALS code at the bottom of your script.

Example:
//Simple moving average crossover signals
Set Breakout = crossover(SMA(close,20), SMA(close,50))
Set Breakdown = crossover(SMA(close,50),SMA(close,20))
//Signals function
Signals(Breakout, Breakdown)

Table of Contents