Pine Script v5 · Strategy
Jigga - Heatmap Comparision
A Pine Script v5 strategy built on RSI (closePrice, 14), EMA (closePrice, 20) and Change (time). It has 2 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 is one contract and pays no commission. 15 settings; defaults include Signal 14, Upper 55 and Lower 45.
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 Jigga - Heatmap Comparision repaint?
- Yes
- At least one pattern in the source can repaint: intrabar recalculation.
- How did Jigga - Heatmap Comparision 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 entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
- Does Jigga - Heatmap Comparision run in Pine Script v6?
- No
- The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L75:C149: 'fill' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download.
- Does Jigga - Heatmap Comparision use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Jigga - Heatmap Comparision run in Zeal Terminal?
- Yes
- It compiles in 34 ms and runs 1,000 bars in 119 ms, in the browser.
BTCUSDT · 1D · default settings
- HLine
- HLine
- HLine
- HLine
- HLine
- HLine
- Winning trade
- Losing trade
- Equity
- Buy and hold
Needs NSE:CNXMETAL D data, not available: not a Binance spot market Needs NSE:CNXFMCG D data, not available: not a Binance spot market Needs NSE:CNXIT D data, not available: not a Binance spot market Needs NSE:CNXPHARMA D data, not available: not a Binance spot market Needs NSE:CNXAUTO D data, not available: not a Binance spot market Values that depend on it are empty on this chart.
- 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, $1,000,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
1 setting does nothing
“------------------------ INDEX ------------------------” is declared but never read.
-
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.
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 |
|---|---|---|---|
| ------------------------ RSI ------------------------ | true | bool | line 25 line 28 |
| Signal | 14 | int | vrsi |
| Upper | 55 | int | up |
| Lower | 45 | int | up |
| ------------------------ EMA CrossOver ------------------------ | false | bool | line 25 line 31 |
| Fast | 20 | int | up |
| Slow | 50 | int | up |
| ------------------------ INDEX ------------------------ | false | bool | unused |
| 1 | NSE:CNXMETAL | symbol | s1Close line 74 |
| 2 | NSE:CNXFMCG | symbol | s2Close line 73 |
| 3 | NSE:CNXIT | symbol | s3Close line 72 |
| 4 | NSE:CNXPHARMA | symbol | s4Close line 71 |
| 5 | NSE:CNXAUTO | symbol | s5Close line 70 |
| ------------------------ Do BackTesting ------------------------ | false | bool | entry In close In line 80 line 82 |
| Buy sell based on sector # | 1 | int · options [1, 2, 3, 4, 5] | refSectorup |
What it calculates
- RSIclosePrice, Signal (14)
vrsi · line 22 - EMAclosePrice, Fast (20)
up · line 26 - Changetime
lapos_x · line 52 - Highest5
lapos_y · line 53
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 In long | strategy.position_size == 0 and refSectorup and doBackTesting | On | 81 |
| Close In | not refSectorup and doBackTesting | On | 83 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Does it repaint?
Yes
At least one pattern in the source can repaint; it is marked Check below.
- ClearHigher-timeframe data5 request.security call(s), none with lookahead on.
- ClearFuture-bar referencesNo negative history offsets such as close[-1].
- CheckIntrabar recalculationreads realtime-only state. Live values can differ from history.
- 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
Not run on other markets: the script requests NSE:CNXMETAL D, NSE:CNXFMCG D, NSE:CNXIT D, NSE:CNXPHARMA D, NSE:CNXAUTO D, and that data is not available here (not a Binance spot market; not a Binance spot market; not a Binance spot market; not a Binance spot market; not a Binance spot market). Its results would rest on empty values.
Similar scripts
Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Jigga - Heatmap Comparision this page | — | v5 strategy | 0.0% | 0 | 0.0% |
| STRATEGY R18-F-BTC by SenatorVonShaft | ema highest rsi | v4 strategy | −8.6% | 11 | 14.4% |
| RSI Cross [xaurr] by livetrend | rsi ema | v4 strategy | +24.4% | 53 | 35.3% |
| IFR2 by EduardoMattje | rsi highest | v4 strategy | +12.1% | 118 | 0.8% |
| Bitpanda Coinrule Template by joshuajcoop01 | rsi ema | v5 strategy | −2.8% | 4 | 4.6% |
| RSI with Slow and Fast MA Crossing Strategy (by Coinrule) by Coinrule | rsi ema | v5 strategy | −2.8% | 4 | 4.6% |
Upgrade and export
Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.
- 4 settings use the untyped input() (line 5, 9, 12, 18). It still compiles in v6; input.int, input.float or input.source state the type.
- No v6-only features. v6 is not needed to run this script.
Clean v5
Not verifiedNeither version placed a trade on any of the 8 markets, so there was nothing to compare.
- Line 5: input() → input.bool()
- Line 9: input() → input.bool()
- Line 12: input() → input.bool()
- Line 18: input() → input.bool()
⋯strategy('Jigga - Heatmap Comparision', overlay=false)-checkRSI = input(true, title='------------------------ RSI ------------------------')+checkRSI = input.bool(true, title='------------------------ RSI ------------------------')length_RSI = input.int(14, title='Signal', inline='RSI')⋯lowerValueRSI = input.int(45, title='Lower', inline='RSI')-checkMA = input(false, title='------------------------ EMA CrossOver ------------------------')+checkMA = input.bool(false, title='------------------------ EMA CrossOver ------------------------')fastMA = input.int(20, title='Fast', inline='EMA Crossover')slowMA = input.int(50, title='Slow', inline='EMA Crossover')-includeIndex = input(false, title='------------------------ INDEX ------------------------')+includeIndex = input.bool(false, title='------------------------ INDEX ------------------------')symbol1 = input.symbol(title='1', defval='NSE:CNXMETAL', inline='Symbol')⋯symbol5 = input.symbol(title='5', defval='NSE:CNXAUTO', inline='Symbol')-doBackTesting = input(false, title='------------------------ Do BackTesting ------------------------')+doBackTesting = input.bool(false, title='------------------------ Do BackTesting ------------------------')refSector = input.int(title='Buy sell based on sector #', defval=1, options=[1, 2, 3, 4, 5])⋯Does it run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L75:C149: 'fill' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯// © jigneshjc-//@version=5+//@version=6strategy('Jigga - Heatmap Comparision', overlay=false)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 34 ms | With a workaround 1,000 bars in 119 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
Zeal Terminal's engine currently reads an order side written as direction = strategy.long as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 81) so the engine trades the way the script says. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
“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.
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/// © jigneshjc//@version=5strategy('Jigga - Heatmap Comparision', overlay=false)checkRSI = input(true, title='------------------------ RSI ------------------------')length_RSI = input.int(14, title='Signal', inline='RSI')upperValueRSI = input.int(55, title='Upper', inline='RSI')lowerValueRSI = input.int(45, title='Lower', inline='RSI')checkMA = input(false, title='------------------------ EMA CrossOver ------------------------')fastMA = input.int(20, title='Fast', inline='EMA Crossover')slowMA = input.int(50, title='Slow', inline='EMA Crossover')includeIndex = input(false, title='------------------------ INDEX ------------------------')symbol1 = input.symbol(title='1', defval='NSE:CNXMETAL', inline='Symbol')symbol2 = input.symbol(title='2', defval='NSE:CNXFMCG', inline='Symbol')symbol3 = input.symbol(title='3', defval='NSE:CNXIT', inline='Symbol')symbol4 = input.symbol(title='4', defval='NSE:CNXPHARMA', inline='Symbol')symbol5 = input.symbol(title='5', defval='NSE:CNXAUTO', inline='Symbol')doBackTesting = input(false, title='------------------------ Do BackTesting ------------------------')refSector = input.int(title='Buy sell based on sector #', defval=1, options=[1, 2, 3, 4, 5])updown(price) => closePrice = price vrsi = ta.rsi(closePrice, length_RSI) up = false down = false if checkRSI and checkMA up := vrsi > upperValueRSI and ta.ema(closePrice, fastMA) > ta.ema(closePrice, slowMA) ? true : vrsi < lowerValueRSI and ta.ema(closePrice, fastMA) < ta.ema(closePrice, slowMA) ? false : up[1] up else if checkRSI up := vrsi > upperValueRSI ? true : vrsi < lowerValueRSI ? false : up[1] up else if checkMA up := ta.ema(closePrice, fastMA) > ta.ema(closePrice, slowMA) ? true : false up ups1Close = request.security(symbol1, timeframe.period, close)s2Close = request.security(symbol2, timeframe.period, close)s3Close = request.security(symbol3, timeframe.period, close)s4Close = request.security(symbol4, timeframe.period, close)s5Close = request.security(symbol5, timeframe.period, close)s1RSIup = updown(s1Close)s2RSIup = updown(s2Close)s3RSIup = updown(s3Close)s4RSIup = updown(s4Close)s5RSIup = updown(s5Close)refSectorup = refSector == 1 ? s1RSIup : refSector == 2 ? s2RSIup : refSector == 3 ? s2RSIup : refSector == 4 ? s4RSIup : s5RSIuph0 = hline(1, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)h1 = hline(2, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)h2 = hline(3, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)h3 = hline(4, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)h4 = hline(5, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)h5 = hline(6, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)lapos_x = timenow + math.round(ta.change(time) * 20)lapos_y = ta.highest(5) // + (0.15 * highest(20))get_bars(Trend) => since_st_buy = ta.barssince(Trend == true) since_st_sell = ta.barssince(Trend == false) [since_st_buy, since_st_sell][since_st_1_buy, since_st_1_sell] = get_bars(s5RSIup)[since_st_2_buy, since_st_2_sell] = get_bars(s4RSIup)[since_st_3_buy, since_st_3_sell] = get_bars(s3RSIup)[since_st_4_buy, since_st_4_sell] = get_bars(s2RSIup)[since_st_5_buy, since_st_5_sell] = get_bars(s1RSIup)heatmap_color(cond1, cond2, colorValue) => cond1 ? colorValue : cond2 ? color.new(color.silver, 20) : naf_draw_label(x, y, _text, _textcolor, _size) => var label Label = na label.delete(Label) Label := label.new(x, y, _text, color=color.new(color.white, 20), textcolor=_textcolor, style=label.style_none, yloc=yloc.price, xloc=xloc.bar_time, size=_size) Labelf_draw_label(lapos_x, 1, symbol5, color.black, size.large)f_draw_label(lapos_x, 2, symbol4, color.black, size.large)f_draw_label(lapos_x, 3, symbol3, color.black, size.large)f_draw_label(lapos_x, 4, symbol2, color.black, size.large)f_draw_label(lapos_x, 5, symbol1, color.black, size.large)fill(h0, h1, color=heatmap_color(since_st_1_sell > since_st_1_buy, since_st_1_sell < since_st_1_buy, color.new(color.fuchsia, 20)), title='Sector5', transp=90)fill(h1, h2, color=heatmap_color(since_st_2_sell > since_st_2_buy, since_st_2_sell < since_st_2_buy, color.new(color.yellow, 20)), title='Sector4', transp=90)fill(h2, h3, color=heatmap_color(since_st_3_sell > since_st_3_buy, since_st_3_sell < since_st_3_buy, color.new(color.lime, 20)), title='Sector3', transp=90)fill(h3, h4, color=heatmap_color(since_st_4_sell > since_st_4_buy, since_st_4_sell < since_st_4_buy, color.new(color.orange, 20)), title='Sector2', transp=90)fill(h4, h5, color=heatmap_color(since_st_5_sell > since_st_5_buy, since_st_5_sell < since_st_5_buy, color.new(color.blue, 20)), title='Sector1', transp=90)if strategy.position_size == 0 and refSectorup and doBackTesting strategy.entry(id='In', direction=strategy.long)if not refSectorup and doBackTesting strategy.close('In')