Define Variables
Define variables to be used in your strategy.
Last updated
Define variables to be used in your strategy.
Last updated
First of all, let’s define a variable inside the strategy. We want to use an SMA indicator within our strategy. To add it, just select it from the left panel of the editor under the Indicators menu and you will notice a using statement, using Signals.Indicators.SMA
, is automatically added into your code. In the background, Signals framework references a binary file of the SMA algorithm from your new strategy.
Except for the two SMA indicators, we will define a Bars variable, which will reference a data stream which consists of hourly bars. The code, after we define all variables, will look like this: