Steven Primo's bollinger bands strategy

Hi, this strategy is taken from a video made by Steven Primo. You can look it up on YouTube if you want to know about it.

It is a mean-reversion strategy based on the Bollinger Bands, in which we wait for 5 consecutive closes above the upper band, and for a short-term top. Once it happens, we place an entry order on this top, with a stop at the nearest bottom before the movement started, and use the difference from the stop and entry point to determine the target. For shorting, it's the same process, but for the downside. From my testing, only long orders were profitable, but you can configure whichever you want.

It works well for directional markets with a low level of noise, as you can see with the BTCUSD chart. One of its caveats is the short number of occurrences, and the long stop loss and target. You can enable a trailing stop, but from my testings, it just made the results worse.

I made some modifications, like removing the MA requirement, since the entry point was above it almost all the time, and I forced the BB to use a log version of the prices, so that discrepancies are eliminated. You'll also notice that you can't select an extension that is lower than 100, and that is intentional, since you're not supposed to enter a trade in which you can lose more than what you can earn.

I chose not to implement any kind of risk management, but I might do that in the future. You can leave your suggestions in the comments.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?