The idea
This open-source strategy was written by Wunderbit Trading and published on the WunderTrading account. It is a Bitcoin trend follower. By default a shorter triple EMA (TEMA, 25) sits on a longer least-squares MA (LSMA, 100). A long is taken when the fast line crosses above the slow line and the close is also above the 50-bar high of a trail built from ATR. Either line can be switched to LSMA, TEMA, EMA, or SMA.
The publication chart is Binance BTCUSDT on the 4-hour timeframe. The entry comments also embed a bot-style string for BINANCE BTC/USDT on 4H, which is how the author wired automation. A dropdown labeled “What trades should be taken” offers LONG, SHORT, BOTH, and NONE, but it defaults to LONG, and the only strategy.entry in the file is for longs. The rules below follow that source. They do not treat shorting as a working feature.

Indicators
- Fast line leadLine1: TEMA(close, 25) by default. In the source, TEMA is 3×EMA − 3×EMA(EMA) + EMA(EMA(EMA)).
- Slow line leadLine2: LSMA, implemented as ta.linreg(close, 100, 0). Both lines accept LSMA, TEMA, EMA, or SMA, with default lengths 25 and 100.
- Custom ATR: Atr(p) smooths true range, default period 8, then multiplies by 3.5 (the input is titled “SL Mutiplier”) to get the step SL1.
- Trail1 updates from close versus the previous trail. If two closes in a row sit below the prior trail, it takes the lower of that prior trail and close + SL1. Otherwise it becomes close − SL1 when close is above the prior trail, or close + SL1 when it is not. A commented branch for ratcheting the trail up is present in the file; this page describes only the live formula.
- Trail1_high is the 50-bar highest value of that trail. It both filters entries and is plotted under the title Long Stop Loss.
Entry rules
- Orders are placed only inside the backtest window. The default runs from 1 January 2016 through 31 December 9999, so it barely clips history.
- When the trade type is LONG or BOTH, and the position is not short: a fast-line cross above the slow line, with Trail1_high < close, opens a long named long.
- The default trade type is LONG. NONE places no orders. SHORT and BOTH are listed, but the source has no short strategy.entry, so it will not open a short.
- The entry comment is a hard-coded string that includes b8f60da7 and a BINANCE BTC/USDT 4H bot-style command. It does not change the chart’s entry logic.
- The default size is 100% of equity, commission is 0.1%, initial capital is 5,000 (currency=USD), and pyramiding is 0.
Exits and position sizing
- First target: 15% above average entry, closing 20% of the position (the input is Long Take Profit 1 Qty).
- Second target: 30% above average entry, closing another 20%. About 60% remains for the close conditions.
- Those two targets are submitted with strategy.exit limits. A 5% stop from average entry is also defined, but it is not a strategy.exit stop; it is part of the close condition.
- strategy.close exits the remaining long if the close falls through Trail1_high, if the slow line crosses above the fast line, or if the close breaks the 5% stop.
- While a long is open, the chart plots both targets in green and Trail1_high in red, titled Long Stop Loss. The fill between the two lines changes with which one is on top, but the plot titles say EMA and SMA, which does not match the TEMA / LSMA defaults.
Inputs (source defaults)
| Input | Default | Purpose |
|---|---|---|
| What trades should be taken | LONG | Order side; only longs are implemented |
| First Trend Line (fast type) | TEMA | Fast-line method: LSMA / TEMA / EMA / SMA |
| First Trend Line (slow type) | LSMA | Slow-line method; the input title is also First Trend Line |
| Length of the First / Second Trend Line | 25 / 100 | Fast and slow lengths |
| Long Take Profit 1 % / Qty | 15 / 20 | First target distance and exit share |
| Long Take Profit 2% / Qty | 30 / 20 | Second target distance and exit share |
| stop loss in % | 5 | Percent stop from average entry, used in strategy.close |
| SL Mutiplier | 3.5 | ATR-trail multiple (spelling as in the source) |
| ATR period | 8 | Period of the custom ATR |
| Source | close | Price source for the trail |
| Backtest Start / Stop | 2016-01-01 / 9999-12-31 | Tester window |
Things to know before using it
- SHORT and BOTH appear as inputs, but there is no short strategy.entry. Switching the dropdown to SHORT will not start a short book.
- Both moving-average type inputs are labeled First Trend Line, and the plot titles say EMA / SMA. Trust the defaults (TEMA 25 and LSMA 100) and the option values, not those labels.
- The fill() call still uses the deprecated transp argument. It usually still draws, but a later Pine change could drop the fill. This page does not edit the source.
- The default size is 100% of equity, which is more aggressive than many “watch the signals first” scripts. Reduce size in the settings if you only want to inspect the rules.
- Entries also require the close to be above the 50-bar high of Trail1, so not every golden cross is taken. The trail is not the same as a textbook chandelier stop.
Installing it on TradingView
- Download the .pine file from Coinpred (active membership required, see below), or check the original page for the latest version.
- Open the Pine Editor on TradingView, create a blank script, paste the full source and save.
- Click Add to chart. To match the author image, start with BTCUSDT on the 4-hour timeframe.
- Leave the trade type on LONG unless you intend to place no orders, then adjust the moving-average types, lengths, targets, or size. Do not expect SHORT to open shorts.
- Study signals and fills in the Strategy Tester before setting alerts. Past results do not guarantee future returns.
About backtest figures
Source, license and version
- Source: https://www.tradingview.com/script/0mCr8Nfv-Automated-Bitcoin-BTC-Investment-Strategy-from-Wunderbit/
- Author: Wunderbit Trading (published under WunderTrading). Source version 2.0 (Pine v5), scriptAccess=open_no_auth.
- License: Mozilla Public License 2.0. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified full source.
- Members can download the .pine file on this page to study the rules. Judge the risk yourself, and follow your venue’s rules.