Strategy · Pine Script v4 · On the chart

ARR VWAP Intraday

by hasnocool· code credited to ALLURI_RAJU

This strategy plots VWAP on the price chart and trades only between a start hour and an end hour.

View on GitHub

Repaints

GitHub stars106on the repository
Pine versionv4older, still runs
Lines of code27
Settings6inputs
LicenceGPL-3.0
Last update2 years ago18 Sep 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

27 lines of Pine Script v4 from ARR VWAP Intraday.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

ARR VWAP Intraday.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ALLURI_RAJU
//@version=4
strategy("ARR VWAP Intraday", overlay=true)
starHrs = input(11, title="Trade start Hours", type=input.integer)
endHrs = input(15, title="Close all trade @ Hours", type=input.integer)
rsiPreiod = input(14, title="RSI Period", type=input.integer)
rsiBuy = input(50, title="Buy when RSI above", type=input.integer)
rsiSell = input(50, title="Sell when RSI Bellow", type=input.integer)
isReversal = input(true, title="Exit on Wap Reversal", type=input.bool)
plot(vwap,color=color.black)
o=(open[1]+close[1])/2
h=max(high,close,o) 
l=min(low,close,o)
c=(open+high+low+close)/4
longCondition = vwap > vwap[1]  and rsi(close,rsiPreiod)>rsiBuy     and hour>starHrs and hour<endHrs
if (longCondition)
    strategy.entry("Buy", strategy.long)
shortCondition =  vwap < vwap[1] and rsi(close,rsiPreiod)<rsiSell  and hour>starHrs and hour<endHrs
if (shortCondition)
    strategy.entry("Sell", strategy.short)
if(isReversal)
    strategy.close("Buy", when = vwap < vwap[1] ,comment = "ExitBuy")
    strategy.close("Sell", when =vwap > vwap[1], comment = "ExitSell")
strategy.close_all(when =   hour == endHrs  , comment = "Exit All")
    
Expand (32 lines)

Overview

ARR VWAP Intraday enters long when VWAP is rising and RSI is above a threshold, and short when VWAP is falling and RSI is below a threshold. If the reversal option is on, it closes a long when VWAP turns down and a short when VWAP turns up. It closes every position at the end hour. There is no stop loss, and signals can change on the live bar.

Details

Published by

hasnocool on GitHub

Code credit

ALLURI_RAJU, as written in the script's header

Type

Strategy, Pine Script v4

Draws

On the price chart

Category

Oscillators & momentum, Volume, Sessions & time

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • The strategy enters trades without a stop loss

Topics

analysisbtcusdtcryptocurrencydatapandaspythonsimulationtradingtradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Trade start Hoursint11starHrs
Close all trade @ Hoursint15endHrs
RSI Periodint14rsiPreiod
Buy when RSI aboveint50rsiBuy
Sell when RSI Bellowint50rsiSell
Exit on Wap ReversalbooltrueisReversal
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

4 stars

This strategy draws on the price chart and identifies mean-reversion opportunities around daily volume-weighted average price (VWAP) bands. It enters long positions when the price crosses above the lower band while the Relative Strength Index indicates oversol

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · MIT GitHub repository of NQ VWAP Reversion [trugurpala]

BTC True Scalp

by iamrichardD
57 stars

This strategy runs an ultra-fast MACD in a separate pane to capture short-term momentum scalps. It filters trade entries using micro-trend direction, volume spikes, and candle body strength within specified session hours. Positions default to two percent of eq

Strategy v6 Oscillators & momentumScalping Repaints
Updated 1 year ago · Apache-2.0 GitHub repository of BTC True Scalp
3 stars

This strategy calculates a Volume-Weighted Moving Average Convergence Divergence (VWMA MACD) and its histogram average to generate trade signals in a separate pane. It enters long positions when the MACD histogram crosses above its simple moving average and sh

Strategy v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD VWMA Strategy
105 stars

This overlay strategy looks for gold scalps from break of structure and change of character. It enters long when a bullish break, a bullish character change, and an optional volume filter align, and short on the opposite set. Optional RSI levels can block trad

Strategy v6 SMC / ICT / price actionOscillators & momentum Repaints

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers