diff --git a/strategies/VWAP_Cross_Strategy.pine b/strategies/VWAP_Cross_Strategy.pine new file mode 100644 index 0000000..e8bb7b7 --- /dev/null +++ b/strategies/VWAP_Cross_Strategy.pine @@ -0,0 +1,20 @@ +// Description: This script implements the VWAP Cross Strategy, which generates buy and sell signals when the price crosses the Volume Weighted Average Price (VWAP) line. This institutional approach is particularly relevant for intraday trading. + //@version=4 + study("VWAP Cross Strategy", shorttitle="VCS", overlay=true) + + // Calculate VWAP + vwap_sum = cum(close * volume) + volume_sum = cum(volume) + vwap = vwap_sum / volume_sum + + // Generate buy and sell signals + buySignal = crossover(close, vwap) + sellSignal = crossunder(close, vwap) + + // Plot VWAP on the chart + plot(vwap, title="VWAP", color=color.orange, linewidth=2) + + // Plot buy and sell arrows + plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small) + plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small) + \ No newline at end of file