Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesEntropy Order Breakout
QuaScript

Entropy Order Breakout

Admin's ChoiceFree

Joins trends the moment return entropy turns ordered

0.0(0)
0 installs 0 0 comments
Q
159 listings

The QuaTick team's QuaScript analyses, run by the native C++ engine.

View Profile
quascriptstrategytrendentropy
Free
Backtest this strategy Open in QuaTick IDE Edit in IDE
Version
Updated
Compatible

Live engine preview

QuaScriptQuaScript

The QuaScript engine's own output on the chart the terminal uses. Change the settings or edit the code and press Run to recompute it.

Entropy Order Breakoutengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)

About

Joins a trend at the moment the market becomes ordered. The Shannon entropy of recent returns falls when moves start to repeat; the first bar it drops below the order level, the strategy enters in the direction of an adaptive average's slope, and it rides the move with a trailing stop until the market turns random again. Entry: entropy crosses below the order level, adaptive mean sloping, close on the right side of it. Exit: ATR trailing stop, or entropy back above the disorder level. Risk: 1 % per trade. Method: Shannon (1948) entropy of the return histogram.


Settings

Entropy window: 60

Histogram bins: 10

Order level: 0.86

Disorder level: 0.93

Adaptive mean: 34

Trailing stop (ATR): 2.2


Measured backtests

Run by the backtest engine on public candles, 2025-11-01 to 2026-11-01, with the script's own commission and slippage, on BTCUSDT 1h (Binance) and ETHUSDT 1h (Binance). The figures per market are in the Measured backtest panel below. Past results do not predict future returns.


Backtest it yourself

Open it on the backtesting page to run it on any symbol, interval and date range, then use Monte Carlo, optimisation, walk-forward and robustness tests.

Strategy Rules

Entry Conditions

  • ▸ entropy crosses below the order level, adaptive mean sloping, close on the right side of it

Exit Conditions

  • ▸ ATR trailing stop, or entropy back above the disorder level

Measured backtest

BTCUSDT 1h (Binance), 2025-11-01 to 2026-11-01 · backtest engine, script costs included

Backtest this strategy

10.8%

Return

0.63

Sharpe

-16.4%

Max DD

14.3%

Win Rate

35

Trades

MarketTradesReturnSharpeMax DDWin rateProfit factor
BTCUSDT 1h3510.8%0.63-16.4%14.3%1.34
ETHUSDT 1h37-12.5%-0.40-23.7%5.4%0.28

Past results on historical data do not predict future returns.

Source Code

Edit in IDE
quascript
1strategy "Entropy Order Breakout" {
2 overlay = true
3 capital = 100000
4 commission = 0.05
5 slippage = 1
6 sizing = risk_percent
7 max_leverage = 1
8 size = 1
9 pyramiding = 1
10}
11/// Joins a trend at the moment the market becomes ordered. The Shannon entropy of recent returns
12/// falls when moves start to repeat; the first bar it drops below the order level, the strategy
13/// enters in the direction of an adaptive average's slope, and it rides the move with a trailing
14/// stop until the market turns random again.
15/// Entry: entropy crosses below the order level, adaptive mean sloping, close on the right side of
16/// it. Exit: ATR trailing stop, or entropy back above the disorder level.
17/// Risk: 1 % per trade. Method: Shannon (1948) entropy of the return histogram.
18use "viz/premium" as pr
19len = param.int(60, title = "Entropy window", min = 20, max = 1000, group = "Entropy")
20bins = param.int(10, title = "Histogram bins", min = 4, max = 40, group = "Entropy")
21order_lv = param.float(0.86, title = "Order level", min = 0.3, max = 0.99, step = 0.01, group = "Entropy")
22chaos_lv = param.float(0.93, title = "Disorder level", min = 0.4, max = 1, step = 0.01, group = "Entropy")
23mean_l = param.int(34, title = "Adaptive mean", min = 5, max = 400, group = "Trend")
24stop_k = param.float(2.2, title = "Trailing stop (ATR)", min = 0.5, max = 8, step = 0.1, group = "Risk")
25e = stat.entropy(math.log(close / close[1]), len, bins)
26c = ta.kaufman(close, mean_l)
27a = ta.atr(20)
28up = c > c[1]
29ordered = e < order_lv and e[1] >= order_lv
30flat = position.size == 0
31if flat and ordered and up and close > c {
32 order.market("L", side.long)
33 exit.bracket("L exit", entry = "L", stop = close - stop_k * a, trail_offset = stop_k * a, trail_trigger = close)
34}
35if flat and ordered and not up and close < c {
36 order.market("S", side.short)
37 exit.bracket("S exit", entry = "S", stop = close + stop_k * a, trail_offset = stop_k * a, trail_trigger = close)
38}
39if position.size != 0 and e > chaos_lv { exit.close_all() }
40risk.max_drawdown(25)
41render.line(c, "Adaptive mean", color = e < order_lv ? (up ? color.cyan.300 : color.fuchsia.300) : color.slate.500, width = 2)
42render.mark(ordered, shape = shape.diamond, at = anchor.above_bar, color = color.amber.300, size = 0.5, title = "Market turns ordered")
43persist t = draw.table.create(anchor.top_right, 4, 2)
44if bar.is_last {
45 pr.heading(t, 2, "Entropy Order Breakout", "Strategy · Shannon entropy")
46 pr.row(t, 2, "Entropy", str.format("{:.3f}", e), e < order_lv ? pr.BULL : pr.LABEL)
47 pr.row(t, 3, "Market", e < order_lv ? "Ordered" : e > chaos_lv ? "Random" : "Mixed", color.white)
48}
49 
Read-only preview. Open in the QuaTick IDE to edit and deploy.

Reviews

No reviews yet. Be the first to review this listing.

Discussion

Sign in to join the discussion. Your posts and replies show up on your profile.