200 Day Moving Average Breakout Indicator

The purpose of this indicator is to detect when the price breaks below the 200-day moving average line.

Start by opening the indicator builder from the Indicators. Click the builder tab.

Now add a moving average operator in the top line. To do this, just select Moving Average from the drop down selector.

Card image cap

Start with a Moving Average operator.

Next configure the settings of the moving average by clicking the cogs icon. Select the parameters tab. Set the indicator averaging period to 200 or your required setting. On a daily chart, this creates a 200-day moving average line. Click the display tab and change the plot series so that the line is plotted on the price axis rather than a separate axis. This will make it easier to spot the crossovers.

Card image cap

Configure the moving average settings.

Click the top row to select it, so that the border is red. Now click the plus icon on the toolbar. This will add a new row above the moving average.

Card image cap

Create a new row and set to Subtract.

Set this to new row to the Subtract operator. The result now should be a line that outputs the 200-day moving average minus the price.

Now set the inputs to the Moving Average and the Subtractor as required. For the purpose of this example, we’ll use the median price.

This line should be positive whenever the price is below the moving average and negative when it’s above the moving average. To preview the result so far, click the spy glass icon.

Card image cap

Preview the result

We’re only interested in the places where the line changes from negative to positive or positive to negative. These are the zero crossings. To detect zero crossings we can use the Dirac delta function. To do this, add a new row above Subtract and set that to Dirac delta.

Card image cap

Add the Dirac delta function

Click the preview button on the Dirac delta row. This should show all of the zero crossings. These are places where the price is crossing the moving average line.

Card image cap

Preview the zero crossings

As we only want to detect where the price crosses below the moving average, we can use the step function. Add a step function by clicking the top row, and then adding a new row above that one by clicking the plus icon on the toolbar. Set this to step function. The step function will output a constant value only where the input is positive. This will filter out the negative to positive zero crossings.

Card image cap

Add a step function in the top row

Now click the preview icon in the top row. The chart should show the places only where the the price is crossing down below the 200-day moving average.

Card image cap

Previewing the completed indicator

Lastly, save the indicator by clicking the disk icon from the toolbar and choosing a name.

Use this Indicator

Risk Disclosure: Information given on this website is for general purposes only and should not be construed as investment advice. Certain instruments shown here are complex and may come with a high risk of losing money rapidly due to leverage. You should consider whether you understand how these instruments work and whether you can afford to take the high risk of losing your money. Market data displayed is indicative and is not a solicitation to buy or sell.