# Price Mean Reversion

This mean reversion strategy is similar to the Bollinger swing trade. It triggers a buy whenever the price moves more than a set distance below the moving average and a sell when it moves more than a set distance above the moving average line. The price move distance is measured in standard deviations.

Go to the Indicator page & choose the builder tab.

Add a subtract operator. Set the first input to a **Moving Average**. Set the second to median price. This will create a line that’s the distance between the moving average and the median price at any bar. Next add a **Greater Than** in the top line. To do this, click to select the **Subtract** row, then click the plus icon in the toolbar. Set the input to **Greater Than**.

Set the second input to **Standard Deviation**. Click to open the settings box of the standard deviation by clicking the cogs icon.

Set the length parameter of the **Standard Deviation** to 50 and number of deviations to 2.5, or as required.

Next set the input to median price. To preview the standard deviation output, click the spyglass icon in that row. The result should look something like the image below.

Click the top row, and then click the plus icon in the toolbar to add a new row above that one. Then set that row to a **Buy** operator.

This logic will now trigger a buy signal whenever the price falls below 2.5 standard deviations of the mean line (moving average). The length of the standard deviation and the moving average are both set to 50. To preview the output, click the spyglass icon in the top row. The result should look something like the chart below, depending on symbol and timeframe.

To save the indicator, click the disk icon in the toolbar and choose a name.