Strategy tutorial: Moving average cross

How to buy & sell on a moving average with StalexBot?

Stan

Last Update 6 years ago

Moving averages can be useful to smooth out choppy price action. The cross of two different moving averages (faster crossing over a slower one) can indicate the start of an uptrend. Here's how to set this up in a StalexBot strategy.

The buy signal

"SMA with period 21 crosses above SMA with period 55"

Link the signal to a buy tile. You can do so by selecting the signal tile (click on it) and then click on the link icon that is on the buy tile. You will see an arrow appear, meaning they are connected.

From the buy tile, we can start creating the sell path. To do so, we can simply copy and reverse the signal tile we called 'SMA cross'. Hover over the signal tile, then hit 'Duplicate'. Drag the tile to below the buytile, and link the buy tile to it. Next we edit the new signal tile and change the operator to 'Cross below' instead.

From the sell signal, we need to link to a sell tile, which instructs our strategy that this is the time to sell the position. The same process as the buy tile is repeated here:

This concludes our SMA cross strategy. The only thing that is left to do, is to configure the markets and as always: run some backtests to see if this likely is a profitable strategy or not. 


For markets, you can either choose them manually (in the markets tab), or use automatic coin selection. Learn more about automatic coin selection in the article below.

Was this article helpful?

2 out of 2 liked this article

Still need help? Message Us