OPEN-SOURCE SCRIPT
RVWAP Mean Reversion Strategy

After reading "Everyone uses VWAP wrong" by EdgeTools I had to built a quick Rolling VWAP Mean Reversion Strategy.
I took the TradingView Rolling VWAP indicator and defined simple long and short entry conditions.
The strategy takes long positions if we dip below the lower band of the RVWAP standard deviation and then crossover and close above. For shorts, if we crossunder and close below the upper band, we enter a short trade.
For both longs and shorts we exit the position after crossing the RVWAP.
The strategy quickly showed its amazing potential. By tweaking the rolling period and the first standard deviation, you can create some amazing backtests.
High win rates are usual and expected, as price always returns to the volume weighted mean average. Depending on the configuration, the Sharp and Sortino ratio indicate a real edge. Though fast declines and rises in the underlying asset may result in bigger drawdowns.
I built in the possibility to chose which direction you want to trade. So you can go only long or only short.
I also included a tool to define your own backtesting range, as the inbuilt tradingview backtester isn't optimized for that in my opinion.
I highly encourage you, to take the code, make a copy and add your own ideas. You may want to have different standard deviations for long and short entries, or you want to define entries with simple crosses. The code is easily edited as long as you don't touch the indicator.
If you got this far reading you absolutely must look into "Everyone uses VWAP wrong"!
I took the TradingView Rolling VWAP indicator and defined simple long and short entry conditions.
The strategy takes long positions if we dip below the lower band of the RVWAP standard deviation and then crossover and close above. For shorts, if we crossunder and close below the upper band, we enter a short trade.
For both longs and shorts we exit the position after crossing the RVWAP.
The strategy quickly showed its amazing potential. By tweaking the rolling period and the first standard deviation, you can create some amazing backtests.
High win rates are usual and expected, as price always returns to the volume weighted mean average. Depending on the configuration, the Sharp and Sortino ratio indicate a real edge. Though fast declines and rises in the underlying asset may result in bigger drawdowns.
I built in the possibility to chose which direction you want to trade. So you can go only long or only short.
I also included a tool to define your own backtesting range, as the inbuilt tradingview backtester isn't optimized for that in my opinion.
I highly encourage you, to take the code, make a copy and add your own ideas. You may want to have different standard deviations for long and short entries, or you want to define entries with simple crosses. The code is easily edited as long as you don't touch the indicator.
If you got this far reading you absolutely must look into "Everyone uses VWAP wrong"!
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.