OPEN-SOURCE SCRIPT

Time Weighted Average Price (TWAP)

TWAP is a tool used by algorithm based traders that allows them to distribute their orders throughout the day without disturbing price or having their positions known to rival traders in the market.

It's similar to VWAP and serves the same function, except it lacks the volume aspect. This can be an issue when position entry/exit may be affected by slippage. The main benefit of TWAP is deciding how to distribute orders throughout the chosen timeframe.

However, just like the VWAP traders will normally use it as a moving average or target for price action to pull into.

There is an option to change the timeframe that TWAP is calculated on.


References:
empirica.io/blog/twap-strategy/
arxiv.org/ftp/arxiv/papers/1206/1206.5324.pdf

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


My published indicators: tradingview.com/u/NeoButane/

Sorry if I haven't replied to your message yet, I'm a bit backlogged :)
Also on:

Disclaimer