Strategy · Pine Script v5 · On the chart

Big Whale Purchases and Sales

by hasnocool· code credited to Powerscooter

This script tracks daily on-chain whale holdings across various cryptocurrencies using IntoTheBlock metric feeds.

View on GitHub

GitHub stars106on the repository
Pine versionv5runs as is
Lines of code74
Settings3inputs
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

74 lines of Pine Script v5 from Big Whale Purchases and Sales.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

Big Whale Purchases and Sales.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Powerscooter
//@version=5
strategy("Big Whale Purchases and Sales", "Big Whale Moves", overlay=true, initial_capital = 100, default_qty_type = strategy.cash, default_qty_value = 100, pyramiding = 5)
UseStrategy = input.bool(false,"Strategy Mode", "Use this box to switch between strategy and indicator mode", group = "Script Settings")
//Inputs
StdDevs = input(2.0,"Standard Deviations", "How many Standard Deviations need to be passed to identify an outlier. 0 will show all changes in whale holdings.", group = "Inputs")
//Chain ID
Source = input.string(title="Blockchain", defval="BTC", options=["BTC", "ETH", "DOGE", "ADA", "MATIC", "SHIB", "UNI", "OKB", "LEO", "LINK", "LTC", "FTT", "CRO", "ALGO",
 "QNT", "BCH", "SAND", "MANA", "FXS", "AAVE", "CHZ", "HT", "LDO", "KCS", "AXS", "MKR", "ZEC", "GRT", "FTM", "SNX", "NEXO", "CRV", "BIT", "DASH", "BAT", "ENS"], group="Inputs")
SourceA = switch Source
    "BTC"   => "INTOTHEBLOCK:BTC_WHALESASSETS"
    "ETH"   => "INTOTHEBLOCK:ETH_WHALESASSETS"
    "DOGE"  => "INTOTHEBLOCK:DOGE_WHALESASSETS"
    "ADA"   => "INTOTHEBLOCK:ADA_WHALESASSETS"
    "MATIC" => "INTOTHEBLOCK:MATIC_WHALESASSETS"
    "SHIB"  => "INTOTHEBLOCK:SHIB_WHALESASSETS"
    "UNI"   => "INTOTHEBLOCK:UNI_WHALESASSETS"
    "OKB"   => "INTOTHEBLOCK:OKB_WHALESASSETS"
    "LEO"   => "INTOTHEBLOCK:LEO_WHALESASSETS"
    "LINK"  => "INTOTHEBLOCK:LINK_WHALESASSETS"
    "LTC"   => "INTOTHEBLOCK:LTC_WHALESASSETS"
    "FTT"   => "INTOTHEBLOCK:FTT_WHALESASSETS"
    "CRO"   => "INTOTHEBLOCK:CRO_WHALESASSETS"
    "ALGO"  => "INTOTHEBLOCK:ALGO_WHALESASSETS"
    "QNT"   => "INTOTHEBLOCK:QNT_WHALESASSETS"
    "BCH"   => "INTOTHEBLOCK:BCH_WHALESASSETS"
    "SAND"  => "INTOTHEBLOCK:SAND_WHALESASSETS"
    "MANA"  => "INTOTHEBLOCK:MANA_WHALESASSETS"
    "FXS"   => "INTOTHEBLOCK:FXS_WHALESASSETS"
    "AAVE"  => "INTOTHEBLOCK:AAVE_WHALESASSETS"
    "CHZ"   => "INTOTHEBLOCK:CHZ_WHALESASSETS"
    "HT"    => "INTOTHEBLOCK:HT_WHALESASSETS"
    "LDO"   => "INTOTHEBLOCK:LDO_WHALESASSETS"
    "KCS"   => "INTOTHEBLOCK:KCS_WHALESASSETS"
    "AXS"   => "INTOTHEBLOCK:AXS_WHALESASSETS"
    "MKR"   => "INTOTHEBLOCK:MKR_WHALESASSETS"
    "ZEC"   => "INTOTHEBLOCK:ZEC_WHALESASSETS"
    "GRT"   => "INTOTHEBLOCK:GRT_WHALESASSETS"
    "FTM"   => "INTOTHEBLOCK:FTM_WHALESASSETS"
    "SNX"   => "INTOTHEBLOCK:SNX_WHALESASSETS"
    "NEXO"  => "INTOTHEBLOCK:NEXO_WHALESASSETS"
    "CRV"   => "INTOTHEBLOCK:CRV_WHALESASSETS"
    "BIT"   => "INTOTHEBLOCK:BIT_WHALESASSETS"
    "DASH"  => "INTOTHEBLOCK:DASH_WHALESASSETS"
    "BAT"   => "INTOTHEBLOCK:BAT_WHALESASSETS"
    "ENS"   => "INTOTHEBLOCK:ENS_WHALESASSETS"
Assets = request.security(SourceA, "D", close)
//Define day to day change
AssetMoves = ta.change(Assets,1)
//Catch outliers
var float bot=0
var float top=0
var float mid=0
if StdDevs != 0
    [mid2,top2,bot2]=ta.bb(AssetMoves,21,StdDevs)
    mid:=mid2
    top:=top2
    bot:=bot2
else
    top:=0
    bot:=0
//Mark the corresponding Bars
plotshape(AssetMoves>top and not UseStrategy,"Purchase",shape.triangleup, location.belowbar, size=size.normal, color=color.green, text = "Purchase", textcolor = color.green)
plotshape(AssetMoves<bot and not UseStrategy,"Sale",shape.triangledown, location.abovebar, size=size.normal, color=color.red, text = "Sale", textcolor = color.red)
//Order Conditions
LongCondition = AssetMoves>top and UseStrategy
ShortCondition = AssetMoves<bot and UseStrategy
//Order Execution
if LongCondition
    strategy.entry("Long", strategy.long)
if ShortCondition
    strategy.entry("Short", strategy.short)
Expand (81 lines)

Overview

Big Whale Purchases and Sales applies Bollinger Bands to day-to-day asset changes to identify statistically significant outlier movements based on a user-selected standard deviation multiplier. When whale holdings surge past the upper band, it signals purchases, and drops below the lower band signal sales. It plots visual markers directly on the price chart and can toggle into a strategy mode that permits pyramiding up to five orders, though it lacks built-in stop-loss rules.

Details

Published by

hasnocool on GitHub

Code credit

Powerscooter, as written in the script's header

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Volume, Volatility & bands

Markets

Crypto

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction
  • 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
Strategy ModeboolfalseUseStrategy
Standard Deviationsfloat2.0StdDevs
BlockchainstringBTCSource
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

257 stars

This overlay strategy is built for ES futures on the one-minute chart. It plots a volume-weighted moving average of price opens and standard-deviation bands at Fibonacci ratios, plus a second longer volume-weighted average from a higher-timeframe open. Call an

Strategy v5 Volatility & bandsMoving averages
Updated 6 weeks ago · None stated GitHub repository of ES Futures 1M No Repaint
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

CombinedBinHAndClucV8

by viktors1982
36 stars

This strategy trades on the price chart using multiple indicators. It enters long positions when price dips meet conditions on Bollinger Bands 40 and 20, RSI, MFI, volume and other thresholds. It exits at custom ROI profit levels based on RSI or after timeout

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of CombinedBinHAndClucV8

VOL/BBW/RSI/15 Strategy

by SammyEnigma
18 stars

This strategy overlays Bollinger Bands on the price chart and trades a long squeeze setup. It enters long when band width is below 0.022 and volume is at least the seven-bar average, using a stop order at the lower band. It places a short order when close cros

Strategy v4 Volatility & bandsVolume
Updated 6 years ago · None stated GitHub repository of VOL/BBW/RSI/15 Strategy

This strategy enters long or short when eight conditions align over the last two bars. It requires EMA 10 and EMA 55 alignment on the one-hour, four-hour and daily charts, a positive ADX slope, matching monitor direction, and price relative to a 400-bar point

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard ABCBitcoin TradingLatino B002
9 stars

VSA Pro: Trend and Rejection is an overlay strategy combining SuperTrend trend filtering with Volume Spread Analysis principles. It calculates SuperTrend direction to enter long positions when a new bullish trend starts and exits all positions when the trend t

Strategy v5 TrendVolume
Updated 4 months ago · MIT GitHub repository of VSA Pro: Trend and Rejection

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