Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Kitchen [ilovealgotrading]

A Pine Script v5 strategy built on Supertrend (3, 10), RSI (close, 14) and SMA or Stoch (3). It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss. Each trade is one contract and pays no commission. 19 settings; defaults include ATR Length 10, Factor 3 and Short Time Period 07 1h.

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 Kitchen [ilovealgotrading] repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Kitchen [ilovealgotrading] 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.
Does Kitchen [ilovealgotrading] 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.
Does Kitchen [ilovealgotrading] use a stop loss?
Yes
strategy.exit sets a stop on line 114, 116.
Does Kitchen [ilovealgotrading] run in Zeal Terminal?
Yes
It compiles in 32 ms and runs 1,000 bars in 121 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,000$2,025Equity from $1,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots. 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. The live re-run is not offered here: the script requests BINANCE:BTCUSDT 240, BINANCE:BTCUSDT 60, which this page cannot load in your browser.

Needs BINANCE:BTCUSDT 240 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Needs BINANCE:BTCUSDT 60 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data 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 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 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.

SettingDefaultType and rangeFeeds
BACKTEST DATE
Start_Timetimestamp('01 January 2017 13:30 +0000')timeTime_interval
End_Timetimestamp('30 April 2024 19:30 +0000')timeTime_interval
Supertrend
ATR Length10intsupertrend2 direction2 supertrend1 direction1
Factor3intsupertrend2 direction2 supertrend1 direction1
Short Time Periodthis timeframe is the value of our short-time supertrend indicator07 1hstring · options ['01 1m','02 3m','03 5m', '04 15m', '05 30m', '06 45m', '07 1h', '08 2h', '09 3h', '10 4h', '11 1D', '12 1W' ]supertrend1 direction1
Long Time Periodthis timeframe is the value of our long-time supertrend indicator10 4hstring · options [ '01 1m','02 3m','03 5m', '04 15m', '05 30m', '06 45m', '07 1h', '08 2h', '09 3h', '10 4h', '11 1D', '12 1W' ]supertrend2 direction2
Stoch RSI
Stoch Rsi Low Limitwhen Stock rsi value crossover Low Limit value we get Long15float · step 0.5line 87
Stoch Rsi Up Limitwhen Stock rsi value crossunder Up Limit value we get Short85float · step 0.5line 90
Stoch Rsi retroactive lengthHow many candles are left behind, even if there is a buy or sell signal, it will be valid now20int · min 1line 86
Stochastic RSI K3int · min 1k
RSI Length14int · min 1rsi1
Stochastic Length14int · min 1k
RSI Sourceclosesourcersi1
Strategy Settings
Dollar Cost Per Position 1000floatentry Long_Open entry Short_Open
Trade_directionBOTHstring · options ['LONG', 'SHORT', 'BOTH']entry Long_Open entry Short_Open line 108 line 110
Long Open Messageif you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Open Message Long Openstringentry Long_Open
Short Open Messageif you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Open Message Short Openstringentry Short_Open
Long Close Messageif you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Close Message Long Closestringexit Long_Close
Short Close Messageif you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Close Message Short Closestringexit Short_Close

What it calculates

  • SupertrendFactor (3), ATR Length (10) · chosen by Long Time Periodsupertrend2 · line 56
  • SupertrendFactor (3), ATR Length (10) · chosen by Long Time Perioddirection2 · line 56
  • SupertrendFactor (3), ATR Length (10) · chosen by Short Time Periodsupertrend1 · line 61
  • SupertrendFactor (3), ATR Length (10) · chosen by Short Time Perioddirection1 · line 61
  • RSIRSI Source (close), RSI Length (14)rsi1 · line 73
  • SMA / Stochta.stoch(rsi1, rsi1, rsi1, lengthStoch), Stochastic RSI K (3)k · line 74

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.

high · low · closehigh · low · closeprice datatime2Long Time Periodsetting · 10 4hfactorFactorsetting · 3atrPeriodATR Lengthsetting · 10time1Short Time Periodsetting · 07 1hclosecloseprice datalengthRSIRSI Lengthsetting · 14lengthStochStochastic Lengthsetting · 14smoothKStochastic RSI Ksetting · 3timetimeprice dataStart_TimeStart_Timesetting · timestamp('01 Janua…End_TimeEnd_Timesetting · timestamp('30 April…trade_directionTrade_directionsetting · BOTHopenopenprice datasupertrend2Supertrend→ supertrend2 · by Long Time …direction2Supertrend→ direction2 · by Long Time P…supertrend1Supertrend→ supertrend1 · by Short Time…direction1Supertrend→ direction1 · by Short Time …rsi1RSI→ rsi1kSMA / Stoch→ kback_long, back_shortback_long · back_short2 valuesTime_intervalTime_intervalconditionentry:Long_OpenOpen Long_Openstrategy.entryentry:Short_OpenOpen Short_Openstrategy.entryexit:Long_Closeexit Long_Closestrategy.exitexit:Short_Closeexit Short_Closestrategy.exitplot:57plotplotplot:58Up Trendplotplot:59Down Trendplotplot:62plotplotplot:63Up Trendplotplot:64Down Trendplotbgcolor:83bgcolorbgcolorplotshape:104Buyplotshapeplotshape:106Sellplotshape

Order rules

OrderFires whenBy defaultLine
Open Long_Open longstrategy.opentrades == 0 and Time_interval and buy_signal and ( trade_direction == 'LONG' or trade_direction == 'BOTH')On109
Open Short_Open shortstrategy.opentrades == 0 and Time_interval and sell_signal and ( trade_direction == 'SHORT' or trade_direction == 'BOTH')On111
Exit Long_Close stopclose < supertrend1 and strategy.position_size > 0On114
Exit Short_Close stopclose > supertrend1 and strategy.position_size < 0On116

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.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe data4 request.security call(s), none with lookahead on.
  • 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

Not run on other markets: the script requests BINANCE:BTCUSDT 240, BINANCE:BTCUSDT 60, and that data is not available here (a lower timeframe than the chart; the engine does not evaluate intrabar data; a lower timeframe than the chart; the engine does not evaluate intrabar data). 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.

ScriptSharesTypeNetTradesMax drawdown
Kitchen [ilovealgotrading] this page—v5 strategy0.0%00.0%
CCI Level Zone by Naruephatsma rsi stochv5 strategyNo trades on this market
AVWAP Strategy by asfbherorsi stoch smav5 strategydoes not run in Zeal Terminal
SRJ RSI Outperformer Strategy by Sapt_Jashrsi smav5 strategy+0.6%82.4%
RSI SMA Crossover Strategy by reeesrsi smav5 strategy+39.8%4230.8%
Short In Downtrend Below MA100 (Coinrule) by Coinrulesma rsiv4 strategy−34.5%9945.4%

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.

  • 7 settings use the untyped input() (line 9, 10, 72, 78, 79, 80, 81). 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 verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 9: input() → input.int()
  • Line 10: input() → input.int()
  • Line 72: input() → input.source()
  • Line 78: input() → input.string()
  • Line 79: input() → input.string()
  • Line 80: input() → input.string()
  • Line 81: input() → input.string()
⋯// supertrend -atrPeriod = input(10, 'ATR Length', group = " #################  Supertrend  ################ ")+atrPeriod = input.int(10, 'ATR Length', group = " #################  Supertrend  ################ ")-factor = input(3, 'Factor', group = " #################  Supertrend  ################ ")+factor = input.int(3, 'Factor', group = " #################  Supertrend  ################ ")time1 = input.string(title='Short Time Period', defval='07 1h', options=['01 1m','02 3m','03 5m',  '04 15m', '05 30m', '06 45m', '07 1h', '08 2h', '09 3h', '10 4h', '11 1D', '12 1W' ], group = " #################  Supertrend  ################ ",tooltip = "this timeframe is the value of our short-time supertrend indicator")⋯lengthStoch = input.int(14, 'Stochastic Length', minval=1, group = " #################  Stoch RSI   ################ ")-src_rsi = input(close, title='RSI Source', group = " #################  Stoch RSI   ################ ")+src_rsi = input.source(close, title='RSI Source', group = " #################  Stoch RSI   ################ ")rsi1 = request.security(syminfo.tickerid, '240', ta.rsi(src_rsi, lengthRSI))⋯trade_direction = input.string(title='Trade_direction', group = " #################  Strategy Settings  ################ ", options=['LONG', 'SHORT', 'BOTH'], defval='BOTH')-Long_message_open = input('Long Open', title = "Long Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Open Message ")+Long_message_open = input.string('Long Open', title = "Long Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Open Message ")-Short_message_open = input('Short Open', title = "Short Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Open Message ")+Short_message_open = input.string('Short Open', title = "Short Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Open Message ")-Long_message_close = input('Long Close', title = "Long Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Close Message ")+Long_message_close = input.string('Long Close', title = "Long Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Close Message ")-Short_message_close = input('Short Close', title = "Short Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Close Message ")+Short_message_close = input.string('Short Close', title = "Short Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Close Message ")Time_interval = time > Start_Time and time < End_Time⋯

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.

⋯// © Baby_whale_to_moon-//@version=5+//@version=6strategy('Kitchen [ilovealgotrading]', overlay=true, format=format.price, initial_capital = 1000)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 32 msWith a workaround 1,000 bars in 121 msNot measured
PineTSNot testedNot testedNot measured

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/// © Baby_whale_to_moon//@version=5strategy('Kitchen [ilovealgotrading]', overlay=true, format=format.price, initial_capital = 1000)// BACKTEST DATEStart_Time = input.time(defval=timestamp('01 January 2017 13:30 +0000'), title='Start_Time', group = " ################# BACKTEST DATE ################ " )End_Time = input.time(defval=timestamp('30 April 2024 19:30 +0000'), title='End_Time', group = " ################# BACKTEST DATE ################ " )// supertrend atrPeriod = input(10, 'ATR Length', group = " #################  Supertrend  ################ ")factor = input(3, 'Factor', group = " #################  Supertrend  ################ ")time1 = input.string(title='Short Time Period', defval='07 1h', options=['01 1m','02 3m','03 5m',  '04 15m', '05 30m', '06 45m', '07 1h', '08 2h', '09 3h', '10 4h', '11 1D', '12 1W' ], group = " #################  Supertrend  ################ ",tooltip = "this timeframe is the value of our short-time supertrend indicator")time2 = input.string(title='Long Time Period', defval='10 4h', options=[ '01 1m','02 3m','03 5m', '04 15m', '05 30m', '06 45m', '07 1h', '08 2h', '09 3h', '10 4h', '11 1D', '12 1W' ], group = " #################  Supertrend  ################ ",tooltip = "this timeframe is the value of our long-time supertrend indicator")res(Resolution) =>    if Resolution == '00 Current'        timeframe.period    else        if Resolution == '01 1m'            '1'        else            if Resolution == '02 3m'                '3'            else                if Resolution == '03 5m'                    '5'                else                    if Resolution == '04 15m'                        '15'                    else                        if Resolution == '05 30m'                            '30'                        else                            if Resolution == '06 45m'                                '45'                            else                                if Resolution == '07 1h'                                    '60'                                else                                    if Resolution == '08 2h'                                        '120'                                    else                                        if Resolution == '09 3h'                                            '180'                                        else                                            if Resolution == '10 4h'                                                '240'                                            else                                                if Resolution == '11 1D'                                                    '1D'                                                else                                                    if Resolution == '12 1W'                                                        '1W'                                                    else                                                        if Resolution == '13 1M'                                                            '1M'// supertrend Long time period [supertrend2, direction2] = request.security(syminfo.tickerid, res(time2), ta.supertrend(factor, atrPeriod))bodyMiddle4 = plot((open + close) / 2, display=display.none)upTrend2 = plot(direction2 < 0 ? supertrend2 : na, 'Up Trend', color=color.new(color.green, 0), style=plot.style_linebr, linewidth=2)downTrend2 = plot(direction2 < 0 ? na : supertrend2, 'Down Trend', color=color.new(color.red, 0), style=plot.style_linebr, linewidth=2)// supertrend short time period [supertrend1, direction1] = request.security(syminfo.tickerid, res(time1), ta.supertrend(factor, atrPeriod))bodyMiddle = plot((open + close) / 2, display=display.none)upTrend = plot(direction1 < 0 ? supertrend1 : na, 'Up Trend', color=color.new(color.yellow, 0), style=plot.style_linebr)downTrend = plot(direction1 < 0 ? na : supertrend1, 'Down Trend', color=color.new(color.orange, 0), style=plot.style_linebr)// Stochastic RSIlow_limit_stoch_rsi = input.float(title = 'Stoch Rsi Low Limit', step=0.5, defval=15, group = " #################  Stoch RSI   ################ ", tooltip = "when Stock rsi value crossover Low Limit value we get Long")up_limit_stoch_rsi = input.float(title = 'Stoch Rsi Up Limit', step=0.5, defval=85, group = " #################  Stoch RSI   ################ ", tooltip = "when Stock rsi value crossunder Up Limit value we get Short")stocrsi_back_length = input.int(20, 'Stoch Rsi retroactive length', minval=1, group = " #################  Stoch RSI   ################ ", tooltip = "How many candles are left behind, even if there is a buy or sell signal, it will be valid now")smoothK = input.int(3, 'Stochastic RSI K', minval=1, group = " #################  Stoch RSI   ################ ")lengthRSI = input.int(14, 'RSI Length', minval=1, group = " #################  Stoch RSI   ################ ")lengthStoch = input.int(14, 'Stochastic Length', minval=1, group = " #################  Stoch RSI   ################ ")src_rsi = input(close, title='RSI Source', group = " #################  Stoch RSI   ################ ")rsi1 = request.security(syminfo.tickerid, '240', ta.rsi(src_rsi, lengthRSI))k = request.security(syminfo.tickerid, '240', ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK))// Strategy settings dollar = input.float(title='Dollar Cost Per Position ', defval=1000, group = " #################  Strategy Settings  ################ ")trade_direction = input.string(title='Trade_direction', group = " #################  Strategy Settings  ################ ", options=['LONG', 'SHORT', 'BOTH'], defval='BOTH')Long_message_open = input('Long Open', title = "Long Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Open Message ")Short_message_open = input('Short Open', title = "Short Open Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Open Message ")Long_message_close = input('Long Close', title = "Long Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Long Close Message ")Short_message_close = input('Short Close', title = "Short Close Message", group = " #################  Strategy Settings  ################ ", tooltip = "if you write your alert window this code {{strategy.order.alert_message}} .When trigger Long signal you will get dynamically what you pasted here for Short Close Message ")Time_interval = time > Start_Time and time < End_Timebgcolor(Time_interval ? color.rgb(255, 235, 59, 95) : na)back_long = 0back_short = 0for i = 1 to stocrsi_back_length by 1    if ta.crossover(k, low_limit_stoch_rsi)[i] == true         back_long += i        back_long    if ta.crossunder(k, up_limit_stoch_rsi)[i] == true         back_short += i        back_short// bgcolor(back_long>0?color.rgb(153, 246, 164, 54):na)// bgcolor(back_short>0?color.rgb(246, 153, 153, 54):na)buy_signal = falsesell_signal = falseif direction2 < 0 and direction1 < 0 and back_long > 0    buy_signal := true    buy_signalif direction2 > 0 and direction1 > 0 and back_short > 0    sell_signal := true    sell_signal//bgcolor(buy_signal  ? color.new(color.lime,90) : na ,title="BUY bgcolor")plotshape( buy_signal[1] == false and  strategy.opentrades == 0 and Time_interval and buy_signal  ? supertrend2 : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white)//bgcolor(sell_signal  ? color.new(color.red,90) : na ,title="SELL bgcolor")plotshape(sell_signal[1] == false and strategy.opentrades == 0 and Time_interval and sell_signal  ? supertrend2 : na , title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white)// Strategy entries if strategy.opentrades == 0 and Time_interval and buy_signal and ( trade_direction == 'LONG' or trade_direction == 'BOTH')    strategy.entry('Long_Open', strategy.long, qty=dollar / close, alert_message=Long_message_open)if strategy.opentrades == 0 and Time_interval and sell_signal and ( trade_direction == 'SHORT' or trade_direction == 'BOTH')    strategy.entry('Short_Open', strategy.short, qty=dollar / close, alert_message=Short_message_open)// Strategy Closeif close < supertrend1 and strategy.position_size > 0     strategy.exit('Long_Close',from_entry = "Long_Open", stop=close, qty_percent=100, alert_message=Long_message_close)if close > supertrend1 and strategy.position_size < 0     strategy.exit('Short_Close',from_entry = "Short_Open", stop=close, qty_percent=100, alert_message=Short_message_close)