Pine Script v4 · Strategy
BNB Burn Buyer
A Pine Script v4 strategy with no technical-analysis calculation. It has 3 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 10% of equity and pays no commission. 3 settings; defaults include # of bars to buy before the burn day. 14, Take Profit % 15.0 and # weeks after Entry to Close Long 2.
Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.
- Does BNB Burn Buyer repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did BNB Burn Buyer do on BTCUSDT 1D with default settings?
- Not measured
- It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
- Can BNB Burn Buyer be converted to Pine Script v5?
- Not tested
- The steps are shown below, but neither version placed a trade on any market tested, so there was nothing to compare and no download is offered.
- Does BNB Burn Buyer use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does BNB Burn Buyer run in Zeal Terminal?
- Yes
- It compiles in 16 ms and runs 1,000 bars in 43 ms, in the browser.
BTCUSDT · 1D · default settings
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- 0.00%
- $0.00
- Buy and hold
- +102.5%
- same period
- Closed trades
- 0
- 0 won · 0 lost
- Profitable
- 0.0%
- of closed trades
- Profit factor
- —
- gross profit ÷ gross loss
- Max drawdown
- 0.00%
- $0.00
One run with the author's default settings, $10,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.
Review
What a careful reader of this script would point out, found by checking the source and the backtest.
-
Check
No stop loss
Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.
-
Check
No commission
The backtest assumes free trading. Results on any real exchange will be lower.
-
Note
No slippage
Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.
-
Note
Uses an argument v6 removed
when = on line 61, 62. The upgraded version below moves each call inside an if block.
Upgrade and export
Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.
- 2 strategy calls use the when = argument (line 61, 62). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
Not verifiedNeither version placed a trade on any of the 8 markets, so there was nothing to compare.
- Line 21: //@version=4 → //@version=5
- Line 36: input(type = input.integer) → input.int()
- Line 53: input(type = input.float) → input.float()
⋯// The strategy itself is very simple, it will buy on the day a burn happens and sell either when it hits TP or 2 weeks after the burn date.-//@version=4+//@version=5strategy("BNB Burn Buyer", overlay=true, pyramiding=1, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, currency="USD")⋯burn13 = timestamp(2020, 10, 17, 0, 0, 0)-i_BuyBeforeBurn = input(14, "# of bars to buy before the burn day.", type=input.integer) * (time-time[1])+i_BuyBeforeBurn = input.int(14, "# of bars to buy before the burn day.") * (time-time[1])burndates = array.new_int(0)⋯f_push( burn13)-i_TP = input(15.0, title="Take Profit %", type=input.float)+i_TP = input.float(15.0, title="Take Profit %")longTake = strategy.position_avg_price * (1 + i_TP/100)⋯Clean v5
Not verifiedNeither version placed a trade on any of the 8 markets, so there was nothing to compare.
- Line 55: input() → input.int()
- Line 61: when = timeToExit >= i_TimeClose → if block
- Line 62: when = high>=longTake → if block
⋯longTake = strategy.position_avg_price * (1 + i_TP/100)-i_TimeClose = input(2, title="# weeks after Entry to Close Long")+i_TimeClose = input.int(2, title="# weeks after Entry to Close Long")var int entryTime = na⋯timeToExit = (time-entryTime)/ 1000 / 60 / 60 / 24 / 7-strategy.close("BNB Burn", when=timeToExit >= i_TimeClose, comment="Time Expired")+if timeToExit >= i_TimeClose+ strategy.close("BNB Burn", comment="Time Expired")-strategy.close("BNB Burn", when=high>=longTake, comment="Take Profit")+if high>=longTake+ strategy.close("BNB Burn", comment="Take Profit")Does it run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯// The strategy itself is very simple, it will buy on the day a burn happens and sell either when it hits TP or 2 weeks after the burn date.-//@version=5+//@version=6strategy("BNB Burn Buyer", overlay=true, pyramiding=1, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, currency="USD")⋯Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| # of bars to buy before the burn day. | 14 | int (written input.integer) | line 39 |
| Take Profit % | 15.0 | float | longTake |
| # weeks after Entry to Close Long | 2 | int | close BNB Burn |
What it calculates
No technical-analysis calculation: the script works on prices and settings directly.
Signal flow
How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open BNB Burn long | array.includes(burndates, time) and strategy.position_size == 0 | On | 59 |
| Close BNB Burn | timeToExit >= i_TimeClose | On | 61 |
| Close BNB Burn | high>=longTake | On | 62 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Does it repaint?
No
No repainting patterns in the source.
- ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
- ClearFuture-bar referencesNo negative history offsets such as close[-1].
- ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
- ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.
The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.
Other markets
The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | 0.0% | +102.5% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | 0.0% | +5.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | 0.0% | +9.8% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | 0.0% | +8.4% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | 0.0% | +16.7% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | 0.0% | +21.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | 0.0% | +148.3% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | 0.0% | +17.1% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
Similar scripts
No other indicator or strategy here shares enough of its calculations.
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 16 ms | Yes 1,000 bars in 43 ms | Not measured |
| PineTS | No v5 and v6 only | — | Not measured |
“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report. PineTS runs Pine Script v5 and v6 only.
Source
Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Gammapips// This is a compiled list of all the BNB token burns to date with TX Hash's on the BNB chain for the most recent burns// And links to the blog posts for Burns done while BNB was still an ERC-20 Token.// I grabbed the dates from each TX used only the days, month, and year the tx occured for this strategy.// https://explorer.binance.org/tx/2E16FBFD0F2BA92BAFFC987F6C33918240141CA8E7E2B7D49AB88E341B8255CE // A08063428AB6140E31333A9793A2DD462E17D6C071F5ABF4CDCE75B4ACD38188// 5B824CC8C9DC7A838E2F02D28F68029B85BCBF02326D4AF907795B4B8844405A// 6047184045F3F761C4E91D81E530A10AAC2887B20E26CBB41A12A0DBAD5BDC3B// D3ED9EFA4A242BD06E667A1F5DF102BC190C9EE76F7DB8005A5633FD7D46732A// 9B29E778EEC20E6AB0676A11E88C7CD00DFAB2849C34B6C6A3EAEE6B4E6A8C6D// 2C976CCADB984C3538D2CF3D674C419ECA04DB296544B0F58FE87119C1AD5020// https://binance.zendesk.com/hc/en-us/articles/360026706152-Binance-Completes-7th-Quarterly-BNB-Burn// https://binance.zendesk.com/hc/en-us/articles/360021824592-Binance-Completes-6th-Quarterly-BNB-Burn// https://binance.zendesk.com/hc/en-us/articles/360018044252-Binance-Completes-5th-Quarter-Token-Burn// https://binance.zendesk.com/hc/en-us/articles/360007242192-Binance-4th-Quarter-Token-Burn// https://binance.zendesk.com/hc/en-us/articles/360002684252-Binance-3rd-Quarterly-Token-Burn// https://binance.zendesk.com/hc/en-us/articles/360000012892-Binance-Coin-Burn-in-2018-Winter// https://binance.zendesk.com/hc/en-us/articles/115002205552-Binance-1st-Quarter-BNB-Burn-Event// The strategy itself is very simple, it will buy on the day a burn happens and sell either when it hits TP or 2 weeks after the burn date.//@version=4strategy("BNB Burn Buyer", overlay=true, pyramiding=1, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, currency="USD")burn1 = timestamp(2017, 10, 18, 0, 0, 0)burn2 = timestamp(2018, 1, 15, 0, 0, 0)burn3 = timestamp(2018, 4, 15, 0, 0, 0)burn4 = timestamp(2018, 7, 17, 0, 0, 0)burn5 = timestamp(2018, 10, 17, 0, 0, 0)burn6 = timestamp(2019, 1, 16, 0, 0, 0)burn7 = timestamp(2019, 4, 16, 0, 0, 0)burn8 = timestamp(2019, 7, 12, 0, 0, 0)burn9 = timestamp(2019, 10, 17, 0, 0, 0)burn10 = timestamp(2020, 1, 18, 0, 0, 0)burn11 = timestamp(2020, 4, 18, 0, 0, 0)burn12 = timestamp(2020, 7, 18, 0, 0, 0)burn13 = timestamp(2020, 10, 17, 0, 0, 0)i_BuyBeforeBurn = input(14, "# of bars to buy before the burn day.", type=input.integer) * (time-time[1])burndates = array.new_int(0)f_push(_burnStamp) => array.push(burndates, _burnStamp-i_BuyBeforeBurn)f_push( burn1)f_push( burn2)f_push( burn3)f_push( burn4)f_push( burn5)f_push( burn6)f_push( burn7)f_push( burn8)f_push( burn9)f_push( burn10)f_push( burn11)f_push( burn12)f_push( burn13)i_TP = input(15.0, title="Take Profit %", type=input.float)longTake = strategy.position_avg_price * (1 + i_TP/100)i_TimeClose = input(2, title="# weeks after Entry to Close Long")var int entryTime = naif array.includes(burndates, time) and strategy.position_size == 0 entryTime := time strategy.entry("BNB Burn", strategy.long)timeToExit = (time-entryTime)/ 1000 / 60 / 60 / 24 / 7strategy.close("BNB Burn", when=timeToExit >= i_TimeClose, comment="Time Expired")strategy.close("BNB Burn", when=high>=longTake, comment="Take Profit")