Premium VWAP Trendfollow Strategy [wbburgin]This is a strongly-revised version of my VWAP Trendfollow Strategy, which follows a substantial reworking to address various structural inefficiencies with the script, such as the narrowing of the standard deviation band upon anchor reset. I will continue updating the original script with planned adjustments, this is a different proof-of-concept that builds off of the original script thesis with a different calculation method and execution.
This strategy is not built for any specific asset or timeframe, and has been backtested on crypto and equities from 1 min-1 day. The previous experimental strategy was heavily-correlated with the actual movement of the asset, which added unpalatable risk to the strategy and increased drawdown. This revised form has a more stable backtesting curve, but I want to heavily emphasize that I cannot guarantee that the strategy will be profitable for your circumstances. Backtesting only goes so far and every exchange has a different fee schedule, which can substantially eat into your profits. At the bottom I will explain the parameters behind the strategy results.
**********
The VWAP Trendfollow Strategy begins with a simple premise: to enter long when the price breaks above the upper standard deviation of a VWAP, and to close the position when the price breaks below the lower standard deviation of the VWAP. This is more effective than initiating the same strategy for a VWMA because the VWAP resets its anchor depending on your chosen anchor period, and the act of resetting its anchor also resets its standard deviation value. As a consequence, in sustained uptrends, the standard deviation is pulled upward to meet the price when the anchor resets, instead of requiring the price to fall all the way back down, as in the lower standard deviation band of the VWMA. This essentially acts as the VWAP itself raising the stop loss at each anchor period, which works well for the overall trend-following strategy.
However, this narrowing can still have consequences for a simple breakout strategy; as the price gradually oscillates towards above or below its standard deviation band, it may cross over the other and produce false signals. This oscillation is worrisome especially when fees are taken into account.
Thus, the premium VWAP Trendfollow strategy has a variable width which detects abnormal narrowing of the band, and adjusts it until it is reasonable to close the variability period. Additionally, a filter is added to the open/close signals to soften the frequency of signals without impacting performance significantly.
This script contains an ATR stop loss and an ATR take profit (which is also a difference between it and the original experimental script), with customizable inputs. The strategy results shown below are with initial capital of $1000, qty entry of 10%, and commissions of 0.06%. It works best on 24/7 instruments, like crypto, but I have found it also works with FAANG stocks or other high volatility / high volume assets. The issue with stocks, however, is that the price can jump/plummet because of abnormal events after-hours, which the strategy cannot pick up on until pre-trading begins the next morning. For that reason I suggest it be used on crypto and, because of its low % profitable (but high average winning trade in relation to its average losing trade), be used on an exchange that has minimal fees or volume-based discounts. In the unfortunate case that you cannot find a minimal fee or volume-discounted fee exchange (such as fellow Americans following the liquidity-retreat on Binance.US), I encourage you to test out the higher anchor periods for the higher timeframes, which will reduce the number of trades and increase the average % per trade.
Additionally, this is a long-term strategy used best for accumulation. It is currently long-only; that may change based off of user input.
**********
Disclaimer
Copyright by wbburgin.
The information contained in my Scripts/Indicators/Algorithms does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Vwapbands
VWAP Trendfollow Strategy [wbburgin]This is an experimental strategy that enters long when the instrument crosses over the upper standard deviation band of a VWAP and enters short when the instrument crosses below the bottom standard deviation band of the VWAP. I have added a trend filter as well, which stops entries that are opposite to the current trend of the VWAP. The trend filter will reduce total false breakouts, thus improving the % profitable while maintaining the overall returns of the strategy. Because this is a trend-following breakout strategy, the % profitable will typically be low but the average % return will be higher. As a rule, be sure to look at the average winning trade % compared to the average losing trade %, and compare that to the % profitable to judge the effectiveness of a strategy. Factor in fees and slippage as well.
This strategy appears to work better with the lower timeframes, and I was impressed with its results. It also appears to work on a wide range of asset classes. There isn't a stop loss or take profit built-in (other than the reversal signals, which close the current trade), so I would encourage you to expand on the strategy based on your own trading parameters.
You can toggle off the bar colors and the trend filter if you so desire.
Future updates to this script (or ideas of improving on it) might include a take profit level set at one standard deviation past the current level and a stop loss level set at one standard deviation closer to the vwap from the current level - or applying a multiple to the two based off of your reward/risk ratio.
About the strategy results below: this is with commissions of 0.5 % per trade.
Volume Weighted Average Price STHello everyone.
I am using vwap standard deviation to find trades.
Above standard deviation 1 is buy
Below standard deviation -1 is sell
Price crossunder of vwap after Buy signal is exit for long trade
Price crossover of vwap after Sell signal is exit for short trade
You can set target points(optional)
You can limit number of trades every day.
Background color changes to gray when today range matches to ATR(14) or you can enable label to see the value at last bar
Contact me for more details if you have any queries.
Cyatophilum VWAP StrategyAn indicator to backtest and automate VWAP custom strategies.
Use the Trend Mode to create Swing Trading strategies or Rotation Mode for Intraday Trading.
Configure your strategy using the Entry Condition Builder and Risk Management features, such as Trailing Stop & Take Profits, Safety Orders, and VWAP Exit conditions.
═════════════════════════════════════════════════════════════════════════
█ HOW IT WORKS
VWAP stands for Volume Weighted Average Price.
It is like a simple moving average that takes volume into account.
It is used by a lot of traders since it has everything one needs to know: price and volume.
The cummulated volume calculation resets every session, which interval can be configured.
From that we can calculate the MVWAP and the Standard Deviation Bands and create strategies around that.
█ HOW TO USE
Trend Mode
Trend Mode is the name for strategies built upon VWAP and price/MVWAP cross, most often for Swing Trading on high timeframes trending markets.
The side traded is often long and trying to beat Buy & Hold.
The trade exit can be triggered by a reversal signal (top chart), or a trailing stop (bottom chart) and take profit.
Rotation Mode
This is the mode for Intraday on low timeframes. It will work best on ranging markets.
We use the Standard Deviation Bands to buy/sell the price at overbougth/oversold levels.
The indicator allows to create complex entry conditions such as "Break out of 3rd bands AND break back in 2nd bands" within a certain amount of time.
We will use either the exit options to close the trade when prices reach an opposite band, or the risk management features explained below.
█ FEATURES
• VWAP settings
Configure the VWAP.
• Entry settings
Choose to go long, short, and if the strategy should reverse or not.
• Trend Mode
Choose to create entries from VWAP cross with price or MVWAP.
• Rotation Mode
Configure the 3 bands and build a condition for entry. The multiple inputs allow to add up different events required to trigger an entry, using 3 logical gates that can be linked together using a AND or OR condition. The events being: "break out", "Break back in" or "Just touches" any of the 3 bands. The condition must be met within a certain period of time to be valid.
• Exit settings
Options to exit trades at the end of every session or when the price reaches an opposite band.
• Stop Loss & Take Profit
Configure your stop loss and take profit for long and short trades.
You can also make a trailing stoploss and a trailing take profit.
• Safety Orders (DCA)
Create a strategy with up to 100 safety orders.
Configure their placement and order size using the price deviation, step scale, take profit type (from base order or total volume), and volume scale settings.
Graphics
A Configuration panel with all the indicator settings, useful for sharing a strategy.
A Backtest Results panel with buy & Hold Comparator.
█ ALERTS
Configure your alert messages for all events in the indicator settings.
Then click "Add Alert". In the popup window, select the option "alert() function calls only", give the alert a name and you are good to go!
█ BACKTEST RESULTS
The backtest settings used in this snapshot are the following:
Initial Capital: 10 000€
Order size: 10% equity
Commission: 0.1€ per order
Slippage : 10 ticks
Please read the author instructions below for access.
VWAP + Fibo Dev Extensions StrategyBased on my VWAP + Fibo deviations indicator, I tested some strategies to see if the indicator can be profitable; and I got it !
This strategy uses:
H1 timeframe
Weekly VWAP
+1.618 / +2.618 / -1.618 / -2.618 Deviations Extensions to create 2 bands
The value of the deviation
First, the 2 bands are plotted : +1.618/+2.618 painted in red and -1.618/-2.618 painted in lime.
Then, we wait for the deviation value to reach at least 150 (see thumbnail) to avoid littles moves when the gaps between bands are too short.
Entry long position :
first candle must crossunder the -1.618 level and low have to stay over the -2.618
low of the second one must stay in the lime band
enter the third one if the deviation value is over limit (150)
Exit long position :
TP : when a high crossover VWAP
SL : when a low crossunder -2.618
Entry short position :
first candle must crossover the +1.618 level and high have to stay under the +2.618
high of the second one must stay in the red band
enter the third one if the deviation value is over limit (150)
Exit short position :
TP : when a low crossunder VWAP
SL : when a high crossover +2.618
Notes :
this strategy uses pyramiding (5), be careful and calculate your risk management
the comission value is set to 0.08% to include slippages when entering a trade because of market orders
This strategy is not an advice to invest, make your own decisions.