Pine Script v5 · Strategy
Gotobi Teriyaki
A Pine Script v5 strategy with no technical-analysis calculation. It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. It has no settings.
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 Gotobi Teriyaki repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 58 of 58 trades.
- How did Gotobi Teriyaki do on BTCUSDT 1D with default settings?
- +2.77%
- From 26 Jan 2024 to 21 Oct 2026, over 193 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Does Gotobi Teriyaki run in Pine Script v6?
- No
- The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 193 before, 137 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
- Does Gotobi Teriyaki use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Gotobi Teriyaki run in Zeal Terminal?
- Yes
- It compiles in 19 ms and runs 1,000 bars in 48 ms, in the browser.
BTCUSDT · 1D · default settings
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +2.77%
- $27,724.80
- Buy and hold
- +102.5%
- same period
- Closed trades
- 193
- 106 won · 87 lost
- Profitable
- 54.9%
- of closed trades
- Profit factor
- 1.28
- gross profit ÷ gross loss
- Max drawdown
- 1.52%
- −$15,533.30
One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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.
Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
The script declares no settings.
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 |
|---|---|---|---|
| Close | not buy_time | On | 17 |
| Close | not sell_time | On | 20 |
| Open buy long | buy_time | On | 23 |
| Open sell short | sell_time | On | 25 |
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, and the live replay matched history.
- 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 | +2.8% | +102.5% | 193 | 55% | 1.28 | 1.5% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | −0.1% | +5.5% | 32 | 41% | 0.85 | 0.3% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +0.1% | +9.8% | 193 | 54% | 1.27 | 0.1% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −0.0% | +8.4% | 32 | 38% | 0.65 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +0.0% | +16.7% | 193 | 52% | 1.10 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | −0.0% | +21.5% | 32 | 44% | 0.77 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +0.0% | +148.3% | 193 | 57% | 1.51 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | −0.0% | +17.1% | 32 | 47% | 0.83 | 0.0% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
The trades
By market direction
| At entry, last 90 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 61 | 52% | $9,151.42 |
| Sideways market | 89 | 58% | $19,071.70 |
| Falling market | 43 | 51% | −$498.33 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
2.6%
The 95th percentile of the worst drawdown when the same 193 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 1.1% to 2.6%; the tick is what actually happened, 1.3%. Order luck alone moves it this much.
The first 150 of 193 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 31 Jan 2024 42,941.10 | 1 Feb 2024 42,580.00 | 1 | −$361.10 |
| long | 6 Feb 2024 42,708.70 | 7 Feb 2024 43,099.00 | 1 | $390.26 |
| long | 10 Feb 2024 47,132.80 | 11 Feb 2024 47,751.10 | 1 | $618.30 |
| long | 16 Feb 2024 51,880.00 | 17 Feb 2024 52,124.10 | 1 | $244.09 |
| long | 21 Feb 2024 52,258.80 | 22 Feb 2024 51,849.40 | 1 | −$409.44 |
| long | 24 Feb 2024 50,744.20 | 25 Feb 2024 51,568.20 | 1 | $824.06 |
| long | 6 Mar 2024 63,724.00 | 7 Mar 2024 66,074.00 | 1 | $2,350.03 |
| long | 9 Mar 2024 68,124.20 | 10 Mar 2024 68,313.30 | 1 | $189.08 |
| long | 16 Mar 2024 69,499.80 | 17 Mar 2024 65,300.60 | 1 | −$4,199.20 |
| long | 21 Mar 2024 67,840.50 | 22 Mar 2024 65,501.30 | 1 | −$2,339.23 |
| long | 26 Mar 2024 69,880.00 | 27 Mar 2024 69,988.00 | 1 | $107.99 |
| long | 30 Mar 2024 69,850.50 | 31 Mar 2024 69,582.20 | 1 | −$268.36 |
| long | 6 Apr 2024 67,820.60 | 7 Apr 2024 68,896.00 | 1 | $1,075.37 |
| long | 11 Apr 2024 70,631.10 | 12 Apr 2024 70,006.20 | 1 | −$624.86 |
| long | 16 Apr 2024 63,420.00 | 17 Apr 2024 63,793.40 | 1 | $373.41 |
| long | 20 Apr 2024 63,818.00 | 21 Apr 2024 64,940.60 | 1 | $1,122.57 |
| long | 26 Apr 2024 64,498.30 | 27 Apr 2024 63,770.00 | 1 | −$728.33 |
| long | 1 May 2024 60,672.00 | 2 May 2024 58,365.00 | 1 | −$2,307.04 |
| long | 4 May 2024 62,882.00 | 5 May 2024 63,892.00 | 1 | $1,010.02 |
| long | 11 May 2024 60,800.00 | 12 May 2024 60,826.00 | 1 | $26.00 |
| long | 16 May 2024 66,206.50 | 17 May 2024 65,235.20 | 1 | −$971.30 |
| long | 21 May 2024 71,446.60 | 22 May 2024 70,148.30 | 1 | −$1,298.28 |
| long | 25 May 2024 68,550.00 | 26 May 2024 69,290.60 | 1 | $740.57 |
| long | 31 May 2024 68,352.20 | 1 Jun 2024 67,540.00 | 1 | −$812.16 |
| long | 6 Jun 2024 71,108.00 | 7 Jun 2024 70,799.10 | 1 | −$308.94 |
| long | 11 Jun 2024 69,540.00 | 12 Jun 2024 67,314.20 | 1 | −$2,225.77 |
| long | 15 Jun 2024 66,044.00 | 16 Jun 2024 66,228.30 | 1 | $184.26 |
| long | 21 Jun 2024 64,870.00 | 22 Jun 2024 64,143.60 | 1 | −$726.43 |
| long | 26 Jun 2024 61,806.00 | 27 Jun 2024 60,865.00 | 1 | −$941.03 |
| long | 29 Jun 2024 60,427.80 | 30 Jun 2024 60,986.70 | 1 | $558.84 |
| long | 6 Jul 2024 56,628.80 | 7 Jul 2024 58,230.10 | 1 | $1,601.34 |
| long | 11 Jul 2024 57,725.80 | 12 Jul 2024 57,339.90 | 1 | −$385.96 |
| long | 16 Jul 2024 64,724.10 | 17 Jul 2024 65,044.00 | 1 | $319.94 |
| long | 20 Jul 2024 66,660.00 | 21 Jul 2024 67,140.00 | 1 | $479.96 |
| long | 26 Jul 2024 65,799.90 | 27 Jul 2024 67,908.00 | 1 | $2,108.05 |
| long | 31 Jul 2024 66,188.00 | 1 Aug 2024 64,628.00 | 1 | −$1,559.99 |
| long | 6 Aug 2024 54,018.80 | 7 Aug 2024 56,022.00 | 1 | $2,003.18 |
| long | 10 Aug 2024 60,838.00 | 11 Aug 2024 60,923.50 | 1 | $85.52 |
| long | 16 Aug 2024 57,541.10 | 17 Aug 2024 58,874.60 | 1 | $1,333.54 |
| long | 21 Aug 2024 59,013.80 | 22 Aug 2024 61,156.00 | 1 | $2,142.23 |
| long | 24 Aug 2024 64,037.20 | 25 Aug 2024 64,157.00 | 1 | $119.78 |
| long | 31 Aug 2024 59,124.00 | 1 Sep 2024 58,974.00 | 1 | −$149.99 |
| long | 6 Sep 2024 56,180.00 | 7 Sep 2024 53,963.00 | 1 | −$2,217.03 |
| long | 11 Sep 2024 57,636.00 | 12 Sep 2024 57,338.00 | 1 | −$297.99 |
| long | 14 Sep 2024 60,498.00 | 15 Sep 2024 59,993.00 | 1 | −$504.97 |
| long | 21 Sep 2024 63,201.10 | 22 Sep 2024 63,349.00 | 1 | $147.92 |
| long | 26 Sep 2024 63,152.00 | 27 Sep 2024 65,174.00 | 1 | $2,021.98 |
| long | 1 Oct 2024 63,327.60 | 2 Oct 2024 60,804.90 | 1 | −$2,522.68 |
| long | 5 Oct 2024 62,086.00 | 6 Oct 2024 62,058.00 | 1 | −$27.99 |
| long | 11 Oct 2024 60,326.40 | 12 Oct 2024 62,540.00 | 1 | $2,213.59 |
| long | 16 Oct 2024 67,074.10 | 17 Oct 2024 67,620.00 | 1 | $545.86 |
| long | 19 Oct 2024 68,428.00 | 20 Oct 2024 68,378.00 | 1 | −$50.00 |
| long | 26 Oct 2024 66,698.30 | 27 Oct 2024 67,092.80 | 1 | $394.44 |
| long | 31 Oct 2024 72,344.80 | 1 Nov 2024 70,292.00 | 1 | −$2,052.74 |
| long | 6 Nov 2024 69,372.00 | 7 Nov 2024 75,572.00 | 1 | $6,199.98 |
| long | 9 Nov 2024 76,509.80 | 10 Nov 2024 76,677.50 | 1 | $167.68 |
| long | 16 Nov 2024 91,032.10 | 17 Nov 2024 90,588.00 | 1 | −$444.10 |
| long | 21 Nov 2024 94,286.60 | 22 Nov 2024 98,317.10 | 1 | $4,030.56 |
| long | 26 Nov 2024 93,010.00 | 27 Nov 2024 91,965.20 | 1 | −$1,044.85 |
| long | 30 Nov 2024 97,460.00 | 1 Dec 2024 96,408.00 | 1 | −$1,052.01 |
| long | 6 Dec 2024 96,945.60 | 7 Dec 2024 99,740.80 | 1 | $2,795.21 |
| long | 11 Dec 2024 96,593.00 | 12 Dec 2024 101,125.00 | 1 | $4,532.00 |
| long | 14 Dec 2024 101,424.00 | 15 Dec 2024 101,420.00 | 1 | −$4.24 |
| long | 21 Dec 2024 97,805.40 | 22 Dec 2024 97,292.00 | 1 | −$513.44 |
| long | 26 Dec 2024 99,429.60 | 27 Dec 2024 95,791.60 | 1 | −$3,638.01 |
| long | 31 Dec 2024 92,792.10 | 1 Jan 2025 93,576.00 | 1 | $783.95 |
| long | 4 Jan 2025 98,174.20 | 5 Jan 2025 98,220.50 | 1 | $46.34 |
| long | 11 Jan 2025 94,726.10 | 12 Jan 2025 94,600.00 | 1 | −$126.11 |
| long | 16 Jan 2025 100,497.00 | 17 Jan 2025 99,987.30 | 1 | −$510.05 |
| long | 21 Jan 2025 102,260.00 | 22 Jan 2025 106,144.00 | 1 | $3,883.82 |
| long | 25 Jan 2025 104,871.00 | 26 Jan 2025 104,747.00 | 1 | −$123.65 |
| long | 31 Jan 2025 104,723.00 | 1 Feb 2025 102,430.00 | 1 | −$2,293.38 |
| long | 6 Feb 2025 96,612.40 | 7 Feb 2025 96,554.40 | 1 | −$58.09 |
| long | 11 Feb 2025 97,430.80 | 12 Feb 2025 95,778.20 | 1 | −$1,652.61 |
| long | 15 Feb 2025 97,500.50 | 16 Feb 2025 97,569.70 | 1 | $69.20 |
| long | 21 Feb 2025 98,305.00 | 22 Feb 2025 96,182.00 | 1 | −$2,123.02 |
| long | 26 Feb 2025 88,680.40 | 27 Feb 2025 84,250.10 | 1 | −$4,430.30 |
| long | 6 Mar 2025 90,606.00 | 7 Mar 2025 89,931.90 | 1 | −$674.12 |
| long | 11 Mar 2025 78,595.90 | 12 Mar 2025 82,933.00 | 1 | $4,337.13 |
| long | 15 Mar 2025 83,983.20 | 16 Mar 2025 84,338.40 | 1 | $355.25 |
| long | 21 Mar 2025 84,223.40 | 22 Mar 2025 84,088.80 | 1 | −$134.59 |
| long | 26 Mar 2025 87,392.90 | 27 Mar 2025 86,909.20 | 1 | −$483.71 |
| long | 29 Mar 2025 84,424.40 | 30 Mar 2025 82,648.50 | 1 | −$1,775.85 |
| long | 5 Apr 2025 83,889.90 | 6 Apr 2025 83,538.00 | 1 | −$351.88 |
| long | 11 Apr 2025 79,607.30 | 12 Apr 2025 83,423.80 | 1 | $3,816.53 |
| long | 16 Apr 2025 83,644.00 | 17 Apr 2025 84,030.40 | 1 | $386.39 |
| long | 19 Apr 2025 84,474.70 | 20 Apr 2025 85,077.00 | 1 | $602.30 |
| long | 26 Apr 2025 94,638.70 | 27 Apr 2025 94,628.00 | 1 | −$10.68 |
| long | 1 May 2025 94,172.00 | 2 May 2025 96,489.90 | 1 | $2,317.90 |
| long | 6 May 2025 94,733.70 | 7 May 2025 96,834.00 | 1 | $2,100.34 |
| long | 10 May 2025 102,972.00 | 11 May 2025 104,810.00 | 1 | $1,837.54 |
| long | 16 May 2025 103,764.00 | 17 May 2025 103,464.00 | 1 | −$299.81 |
| long | 21 May 2025 106,850.00 | 22 May 2025 109,644.00 | 1 | $2,793.99 |
| long | 24 May 2025 107,318.00 | 25 May 2025 107,762.00 | 1 | $443.60 |
| long | 31 May 2025 103,985.00 | 1 Jun 2025 104,592.00 | 1 | $606.41 |
| long | 6 Jun 2025 101,509.00 | 7 Jun 2025 104,288.00 | 1 | $2,779.74 |
| long | 11 Jun 2025 110,274.00 | 12 Jun 2025 108,645.00 | 1 | −$1,629.26 |
| long | 14 Jun 2025 106,067.00 | 15 Jun 2025 105,415.00 | 1 | −$651.96 |
| long | 21 Jun 2025 103,298.00 | 22 Jun 2025 102,120.00 | 1 | −$1,177.96 |
| long | 26 Jun 2025 107,341.00 | 27 Jun 2025 106,947.00 | 1 | −$393.53 |
| long | 1 Jul 2025 107,147.00 | 2 Jul 2025 105,681.00 | 1 | −$1,465.38 |
| long | 5 Jul 2025 107,984.00 | 6 Jul 2025 108,198.00 | 1 | $213.87 |
| long | 11 Jul 2025 116,010.00 | 12 Jul 2025 117,528.00 | 1 | $1,517.65 |
| long | 16 Jul 2025 117,758.00 | 17 Jul 2025 118,630.00 | 1 | $872.36 |
| long | 19 Jul 2025 117,925.00 | 20 Jul 2025 117,840.00 | 1 | −$84.83 |
| long | 26 Jul 2025 117,614.00 | 27 Jul 2025 117,920.00 | 1 | $305.68 |
| long | 31 Jul 2025 117,840.00 | 1 Aug 2025 115,764.00 | 1 | −$2,076.22 |
| long | 6 Aug 2025 114,130.00 | 7 Aug 2025 114,992.00 | 1 | $862.52 |
| long | 9 Aug 2025 116,675.00 | 10 Aug 2025 116,462.00 | 1 | −$212.49 |
| long | 16 Aug 2025 117,342.00 | 17 Aug 2025 117,381.00 | 1 | $38.62 |
| long | 21 Aug 2025 114,271.00 | 22 Aug 2025 112,500.00 | 1 | −$1,771.23 |
| long | 26 Aug 2025 110,112.00 | 27 Aug 2025 111,763.00 | 1 | $1,651.24 |
| long | 30 Aug 2025 108,377.00 | 31 Aug 2025 108,816.00 | 1 | $438.93 |
| long | 6 Sep 2025 110,660.00 | 7 Sep 2025 110,188.00 | 1 | −$472.02 |
| long | 11 Sep 2025 113,960.00 | 12 Sep 2025 115,483.00 | 1 | $1,522.69 |
| long | 16 Sep 2025 115,350.00 | 17 Sep 2025 116,789.00 | 1 | $1,439.25 |
| long | 20 Sep 2025 115,632.00 | 21 Sep 2025 115,686.00 | 1 | $53.24 |
| long | 26 Sep 2025 108,994.00 | 27 Sep 2025 109,643.00 | 1 | $648.97 |
| long | 1 Oct 2025 114,049.00 | 2 Oct 2025 118,595.00 | 1 | $4,546.05 |
| long | 4 Oct 2025 122,232.00 | 5 Oct 2025 122,391.00 | 1 | $158.78 |
| long | 11 Oct 2025 112,774.00 | 12 Oct 2025 110,644.00 | 1 | −$2,130.09 |
| long | 16 Oct 2025 110,763.00 | 17 Oct 2025 108,194.00 | 1 | −$2,569.01 |
| long | 21 Oct 2025 110,532.00 | 22 Oct 2025 108,298.00 | 1 | −$2,234.43 |
| long | 25 Oct 2025 111,005.00 | 26 Oct 2025 111,646.00 | 1 | $641.37 |
| long | 31 Oct 2025 108,323.00 | 1 Nov 2025 109,608.00 | 1 | $1,285.14 |
| long | 6 Nov 2025 103,885.00 | 7 Nov 2025 101,346.00 | 1 | −$2,539.12 |
| long | 11 Nov 2025 106,011.00 | 12 Nov 2025 103,059.00 | 1 | −$2,952.13 |
| long | 15 Nov 2025 94,594.00 | 16 Nov 2025 95,596.20 | 1 | $1,002.23 |
| long | 21 Nov 2025 86,637.20 | 22 Nov 2025 85,129.40 | 1 | −$1,507.80 |
| long | 26 Nov 2025 87,370.00 | 27 Nov 2025 90,484.00 | 1 | $3,114.04 |
| long | 29 Nov 2025 90,890.70 | 30 Nov 2025 90,802.40 | 1 | −$88.27 |
| long | 6 Dec 2025 89,330.00 | 7 Dec 2025 89,236.80 | 1 | −$93.24 |
| long | 11 Dec 2025 92,015.40 | 12 Dec 2025 92,513.40 | 1 | $498.00 |
| long | 16 Dec 2025 86,432.10 | 17 Dec 2025 87,863.40 | 1 | $1,431.35 |
| long | 20 Dec 2025 88,136.90 | 21 Dec 2025 88,360.90 | 1 | $223.96 |
| long | 26 Dec 2025 87,225.30 | 27 Dec 2025 87,369.60 | 1 | $144.29 |
| long | 31 Dec 2025 88,485.50 | 1 Jan 2026 87,648.20 | 1 | −$837.29 |
| long | 6 Jan 2026 93,859.70 | 7 Jan 2026 93,748.00 | 1 | −$111.74 |
| long | 10 Jan 2026 90,641.30 | 11 Jan 2026 90,504.70 | 1 | −$136.57 |
| long | 16 Jan 2026 95,604.80 | 17 Jan 2026 95,550.90 | 1 | −$53.87 |
| long | 21 Jan 2026 88,427.70 | 22 Jan 2026 89,454.70 | 1 | $1,027.07 |
| long | 24 Jan 2026 89,600.30 | 25 Jan 2026 89,225.30 | 1 | −$374.92 |
| long | 31 Jan 2026 84,260.50 | 1 Feb 2026 78,741.10 | 1 | −$5,519.40 |
| long | 6 Feb 2026 62,909.90 | 7 Feb 2026 70,580.30 | 1 | $7,670.39 |
| long | 11 Feb 2026 68,841.30 | 12 Feb 2026 67,082.50 | 1 | −$1,758.76 |
| long | 14 Feb 2026 68,854.00 | 15 Feb 2026 69,822.90 | 1 | $968.97 |
| long | 21 Feb 2026 68,020.00 | 22 Feb 2026 67,975.90 | 1 | −$44.07 |
| long | 26 Feb 2026 67,988.00 | 27 Feb 2026 67,485.20 | 1 | −$502.85 |
| long | 6 Mar 2026 70,891.00 | 7 Mar 2026 68,114.00 | 1 | −$2,777.00 |
| long | 11 Mar 2026 69,948.60 | 12 Mar 2026 70,191.90 | 1 | $243.22 |
Similar scripts
No other indicator or strategy here shares enough of its calculations.
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.
- No v6-only features. v6 is not needed to run this script.
Clean v5
VerifiedNothing to change.
Does it run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 193 before, 137 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯// © hosono_p-//@version=5+//@version=6strategy("Gotobi Teriyaki", overlay=true)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 19 ms | Yes 1,000 bars in 48 ms | Not measured |
| PineTS | Not tested | Not tested | 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.
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/// © hosono_p//@version=5strategy("Gotobi Teriyaki", overlay=true)current_day= dayofmonth(time("1"), "Asia/Tokyo")saturday = dayofmonth(time("1")+ 1000*60*60*24 , "Asia/Tokyo")sunday = dayofmonth(time("1")+ 1000*60*60*48, "Asia/Tokyo")is_5day_10day= current_day % 5==0flyday = dayofweek(time("1"), "Asia/Tokyo") == 6flyday_5day_10day = (flyday and saturday % 5==0) or (flyday and sunday % 5==0)buy_time = time("1", "0200-0955:23456","Asia/Tokyo") and is_5day_10day or time("1", "0200-0955:23456","Asia/Tokyo") and flyday_5day_10daybgcolor(buy_time ? color.new(color.green, 90) : na)sell_time = time("1", "0955-1500:23456","Asia/Tokyo") and is_5day_10day or time("1", "0955-1500:23456","Asia/Tokyo") and flyday_5day_10daybgcolor(sell_time ? color.new(color.red, 90) : na)if strategy.position_size > 0 if not buy_time strategy.close_all()if strategy.position_size < 0 if not sell_time strategy.close_all() if strategy.position_size == 0 if buy_time strategy.entry("buy",strategy.long) if sell_time strategy.entry("sell",strategy.short)