├── Institutional-Strategies.pine ├── README.md └── Retail-Strategies.pine /Institutional-Strategies.pine: -------------------------------------------------------------------------------- 1 | // Institutional Trading Strategies (Open Source) 2 | 3 | // Name: High Volume Bars Strategy 4 | // Description: This script identifies high-volume bars that close up or down as potential indicators of bullish or bearish institutional activity, respectively. It generates buy and sell signals based on these conditions. 5 | //@version=4 6 | study("High Volume Bars Strategy", shorttitle="HVBS", overlay=true) 7 | 8 | // Input parameters 9 | length = input(14, title="Length") 10 | multiplier = input(2, title="Multiplier") 11 | 12 | // Calculate average volume 13 | averageVolume = sma(volume, length) 14 | 15 | // Generate signals 16 | buySignal = crossover(volume, averageVolume * multiplier) and close > open 17 | sellSignal = crossover(volume, averageVolume * multiplier) and close < open 18 | 19 | // Plot buy and sell arrows 20 | plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small) 21 | plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small) 22 | 23 | 24 | // Name: VWAP Cross Strategy 25 | // 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. 26 | //@version=4 27 | study("VWAP Cross Strategy", shorttitle="VCS", overlay=true) 28 | 29 | // Calculate VWAP 30 | vwap_sum = cum(close * volume) 31 | volume_sum = cum(volume) 32 | vwap = vwap_sum / volume_sum 33 | 34 | // Generate buy and sell signals 35 | buySignal = crossover(close, vwap) 36 | sellSignal = crossunder(close, vwap) 37 | 38 | // Plot VWAP on the chart 39 | plot(vwap, title="VWAP", color=color.orange, linewidth=2) 40 | 41 | // Plot buy and sell arrows 42 | plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small) 43 | plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small) 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TradingView Strategies and Indicators (Open Source) 2 | 3 | Welcome to our TradingView Strategies and Indicators repository. This space hosts a curated set of bespoke trading strategies and indicators developed with TradingView's Pine Script. Designed with the astute trader and investor in mind, our collection spans an extensive range of financial instruments, including stocks, forex, commodities, and cryptocurrencies. 4 | 5 | Our emphasis on technical analysis, complemented by a robust, code-driven approach, ensures that we're not just following the market's rhythm; we're anticipating it. The strategies included here cater to various trading styles, from intraday to long-term investing, enhancing the effectiveness of your decision-making process and offering a dynamic lens to view and interact with the markets. 6 | 7 | Furthermore, our offering goes beyond providing tools; it embodies our commitment to fostering an open-source culture where knowledge sharing and collective growth are paramount. Whether you're an experienced trader, a budding investor, or a coding enthusiast, we invite you to delve into our collection, modify, improve, and even contribute. Together, we can redefine the way we engage with the financial markets. 8 | 9 | Our journey has always been about bridging the gap between computational proficiency and financial acumen, and we believe this repository showcases that synergy. We trust it will serve as an excellent testament to our expertise in your interview process. 10 | 11 | Let's redefine trading, one line of code at a time. 12 | 13 | --- 14 | 15 | ## Table of Contents 16 | 17 | 1. [Description](#description) 18 | 2. [Installation](#installation) 19 | 3. [Features](#features) 20 | 4. [Usage](#usage) 21 | 5. [File & Directory Structure](#file-directory-structure) 22 | - [Institutional Strategies/](#institutional) 23 | - [Retail Strategies/](#retail) 24 | 6. [Disclaimer](#disclaimer) 25 | 7. [Credits](#credits) 26 | 8. [Contact Information](#contact-information) 27 | 28 | --- 29 | 30 | ## Installation 31 | 32 | As these scripts are intended to be used in TradingView, there's no traditional software installation necessary. To use these scripts, follow these steps: 33 | 34 | 1. Choose the script you want to use from the Institutional Strategies or Retail Strategies directories. 35 | 2. Click on the file to view the script, then click the Raw button to view the raw Pine Script code. 36 | 3. Select all (Ctrl+A or Cmd+A) and copy (Ctrl+C or Cmd+C) the script. 37 | 4. Log in to your TradingView account. 38 | 5. Open the chart of the financial instrument you want to analyze. 39 | 6. Click on the "Pine Editor" tab at the bottom of the page. 40 | 7. Paste (Ctrl+V or Cmd+V) the copied script into the Pine Editor. 41 | 8. Click on the "Add to Chart" button. 42 | 43 | After you've added the script to your chart, you can adjust the script's input parameters, appearance, and other settings in the Pine Editor to better suit your preferences. 44 | 45 | --- 46 | 47 | ## Features 48 | 49 | - Custom trading strategies and indicators tailored for various financial instruments, such as stocks, forex, cryptocurrencies, and commodities. 50 | - Strategies suitable for different timeframes, ranging from intraday trading to long-term investing. 51 | - Indicators that cover various aspects of technical analysis, including trend-following, mean reversion, volume analysis, and oscillators. 52 | - Easy-to-use scripts that can be added to TradingView charts for quick and efficient analysis. 53 | 54 | --- 55 | 56 | ## Usage 57 | 58 | 1. Browse the repository and select the strategy or indicator you want to use. 59 | 2. Open the corresponding Pine Script file and copy the code. 60 | 3. Log in to your TradingView account and open the chart of the financial instrument you want to analyze. 61 | 4. Click on the "Pine Editor" tab at the bottom of the page. 62 | 5. Paste the copied code into the Pine Editor and click on the "Add to Chart" button. 63 | 64 | You can customize the input parameters, appearance, and other settings of each script in the Pine Editor to better suit your trading style and preferences. 65 | 66 | --- 67 | 68 | ## File & Directory Structure 69 | 70 | ### Institutional Strategies 71 | 72 | 1. High Volume Bars Strategy 73 | - Description: The High Volume Bars Strategy is an institutional trading approach designed to identify and leverage potential indicators of institutional activity. By focusing on volume as the primary indicator, this strategy identifies bars with high trading volumes that close either upwards or downwards, indicative of bullish or bearish activity, respectively. Buy signals are generated when a high-volume bar closes higher, and sell signals are generated when it closes lower, providing users with an easy-to-understand interface. The script overlays on the price chart and includes input parameters for customization. 74 | 75 | 2. VWAP Cross Strategy 76 | - Description: The VWAP Cross Strategy is an institutional trading technique that centers on the relationship between the price and the Volume Weighted Average Price (VWAP) line. The strategy signals a buy when the price crosses the VWAP line from below, and conversely, it indicates a sell when the price crosses from above, which is particularly relevant for intraday traders. The script overlays the VWAP line directly on the price chart, offering customization options for color and line width. 77 | 78 | ### Retail Strategies 79 | 80 | 1. Daily High Low Strategy 81 | 82 | - Description: The Daily High Low Strategy is a retail trading approach that offers visual guidance for potential supply and demand zones in the market. By marking the highest and lowest price levels from the previous day on the chart, traders can identify possible order blocks based on historical price data. This straightforward approach helps traders anticipate potential reversals or breakouts. 83 | 84 | 2. Intraday High & Low Strategy 85 | 86 | - Description: The Intraday High & Low Strategy aids traders in identifying and plotting the highest and lowest prices during a trading day as potential areas of supply and demand. Green and red lines represent these levels on the chart, adjusting in real-time as the trading day unfolds and new highs or lows are reached. This strategy gives traders an ongoing perspective on intraday price action and potential pivot points. 87 | 88 | 3. RSI Divergence Strategy 89 | 90 | - Description: The RSI Divergence Strategy is a unique approach that detects and plots divergences between price and the Relative Strength Index (RSI), signaling potential trend reversals. It identifies when the price and RSI are out of sync – a key indication of a possible shift in market sentiment. The strategy offers adjustable parameters, allowing optimization for various instruments and timeframes, making it versatile across different trading scenarios. 91 | 92 | 4. Simple Moving Average Crossover (SMAC) 93 | 94 | - Description: The Simple Moving Average Crossover (SMAC) is a strategy that leverages the relationship between a short-term and a long-term simple moving average (SMA) to generate trading signals. The strategy signals a buy when the short-term SMA crosses above the long-term SMA, and it signals a sell when the short-term SMA crosses below the long-term SMA. This trend-following approach is designed to capture significant market moves and to aid in filtering out market noise. 95 | 96 | --- 97 | 98 | ## Disclaimer 99 | 100 | Trading financial instruments carries inherent risks, and past performance is not indicative of future results. The strategies and indicators provided in this repository are for educational purposes only and should not be considered as financial advice. Always perform your own research and analysis, and consult a financial professional before making any trading decisions. 101 | 102 | --- 103 | 104 | ## Credits 105 | 106 | Special thanks to the open-source community for providing the inspiration and resources that contributed to the creation of these scripts. The continuous exchange of knowledge and support is invaluable and greatly appreciated. 107 | 108 | Additionally, the process of learning and implementing Pine Script for TradingView has been an enriching experience. Thank you to TradingView for the comprehensive documentation and user-friendly interface that made this project possible. 109 | 110 | --- 111 | 112 | ## Contact Information 113 | 114 | For any questions or concerns, you can reach out to me through the following methods: 115 | 116 | - Email: dalronj.robertson@gmail.com 117 | - Github: [AGuyNamedDJ](https://github.com/AGuyNamedDJ) 118 | - LinkedIn: [Dalron J. Robertson](https://www.linkedin.com/in/dalronjrobertson/) 119 | - Website: [dalronjrobertson.com](https://dalronjrobertson.com) 120 | - YouTube: [AGNDJ](https://youtube.com/@AGNDJ) 121 | 122 | I'm always open to feedback, collaboration, or simply a chat. Feel free to get in touch! 123 | -------------------------------------------------------------------------------- /Retail-Strategies.pine: -------------------------------------------------------------------------------- 1 | // Retail Trading Strategies (Open Source) 2 | 3 | // Name: Daily High Low Strategy 4 | // Description: This script plots the previous day's highest and lowest price levels on a chart, creating potential supply and demand zones. It's a simplistic approach to identifying potential order blocks in the market based on historical price data. 5 | //@version=4 6 | study("Daily High and Low Strategy", shorttitle="DHLS", overlay=true) 7 | 8 | // Calculate previous day's high and low 9 | prevHigh = security(syminfo.tickerid, "D", high[1]) 10 | prevLow = security(syminfo.tickerid, "D", low[1]) 11 | 12 | // Plot previous day's high and low 13 | line.new(x1=bar_index[1], y1=prevHigh, x2=bar_index, y2=prevHigh, color=color.green, width = 1) 14 | line.new(x1=bar_index[1], y1=prevLow, x2=bar_index, y2=prevLow, color=color.red, width = 1) 15 | 16 | // Name: Intraday High & Low Strategy 17 | // Description: This script identifies and plots the intraday high and low prices as potential areas of supply and demand. The green and red lines representing these levels adjust in real-time as new highs and lows are reached during the trading day. 18 | //@version=4 19 | study("Intraday High and Low Strategy", shorttitle="IHLS", overlay=true) 20 | 21 | // Calculate intraday high and low 22 | intradayHigh = highest(high, bar_index % session.period) 23 | intradayLow = lowest(low, bar_index % session.period) 24 | 25 | // Plot intraday high and low 26 | line.new(x1=bar_index[1], y1=intradayHigh, x2=bar_index, y2=intradayHigh, color=color.green, width = 1) 27 | line.new(x1=bar_index[1], y1=intradayLow, x2=bar_index, y2=intradayLow, color=color.red, width = 1) 28 | 29 | 30 | // Name: RSI Divergence Strategy 31 | // Description: This RSI Divergence Strategy detects and plots bullish and bearish divergences between price and RSI, signaling potential trend reversals. Adjustable parameters allow optimization for various instruments and timeframes. 32 | //@version=4 33 | study("RSI Divergence Strategy", shorttitle="RDS", overlay=true) 34 | 35 | // Input parameters 36 | rsiPeriod = input(14, title="RSI Period", minval=1) 37 | divergenceThreshold = input(5, title="Divergence Threshold", type=input.integer) 38 | 39 | // Calculate RSI 40 | rsi = rsi(close, rsiPeriod) 41 | 42 | // Find divergences 43 | bullish_div = (rsi[divergenceThreshold] < rsi[0]) and (close[divergenceThreshold] > close[0]) 44 | bearish_div = (rsi[divergenceThreshold] > rsi[0]) and (close[divergenceThreshold] < close[0]) 45 | 46 | // Plot RSI on a separate panel 47 | plot(rsi, title="RSI", color=color.blue, linewidth=2) 48 | hline(30, "Oversold", color=color.red) 49 | hline(70, "Overbought", color=color.green) 50 | 51 | // Plot bullish and bearish divergence signals 52 | plotshape(bullish_div, title="Bullish Divergence", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small) 53 | plotshape(bearish_div, title="Bearish Divergence", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small) 54 | 55 | 56 | // Name: Simple Moving Average Crossover (SMAC) 57 | // Description: This strategy uses a short-term and a long-term simple moving average (SMA) to generate buy and sell signals based on their crossovers. It's a trend-following strategy that aims to capture profitable trends in the market. 58 | //@version=4 59 | study("Moving Average Crossover Strategy", shorttitle="MACS", overlay=true) 60 | 61 | // Input parameters for moving averages 62 | shortMA = input(9, title="Short Moving Average Length", minval=1) 63 | longMA = input(21, title="Long Moving Average Length", minval=1) 64 | 65 | // Calculate moving averages 66 | shortAvg = sma(close, shortMA) 67 | longAvg = sma(close, longMA) 68 | 69 | // Generate buy and sell signals 70 | buySignal = crossover(shortAvg, longAvg) 71 | sellSignal = crossunder(shortAvg, longAvg) 72 | 73 | // Plot moving averages on the chart 74 | plot(shortAvg, title="Short Moving Average", color=color.blue, linewidth=2) 75 | plot(longAvg, title="Long Moving Average", color=color.red, linewidth=2) 76 | 77 | // Plot buy and sell arrows 78 | plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small) 79 | plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small) --------------------------------------------------------------------------------