Simple Trading Strategy Based on Random Luck
This strategy is named "Simple Trading Strategy Based on Random Luck". It uses random methods to generate long or short signals on the first trading day of each week, evaluating the performance of random trading…
This strategy is named "Simple Trading Strategy Based on Random Luck". It uses random methods to generate long or short signals on the first trading day of each week, evaluating the performance of random trading through large amount of repetitive testing.
Specifically, the trading logic is very straightforward:
Flip a coin on every Monday, randomly generating heads or tails results.
If heads, go long that day. If tails, go short that day.
Set stop loss at 1 x ATR and take profit at 1 x ATR when long, vice versa when short, achieving 1:1 risk-reward ratio.
Hold position until end of the week then close.
The advantage is backtesting many years of data to evaluate average win rate of random trading. The trading rules are extremely simple and can serve as a benchmark baseline for comparison.
But random trading cannot utilize market patterns and will unlikely generate sustained gains. Fixed stop loss and take profit also risk enlarging losses. Traders can only use it as an experimental strategy, not for live trading.
In conclusion, backtest results may suggest outcomes of random trading, but do not represent actually applicable strategies. Traders ultimately still need discretion and systematic trading techniques.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 20 | ATR Period |
| v_input_2 | 2022 | Year to Test |
| v_input_3 | true | Day of Week |
Source Pine Script
/*backtest
start: 2022-09-12 00:00:00
end: 2023-01-12 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("CoinFlip", overlay = true)
int result = int(math.random()+0.5)
atr_period = input(defval = 20, title = "ATR Period")
year_to_test = input(defval = 2022, title = "Year to Test")
day_of_week = input(defval = 1, title = "Day of Week")
atr = ta.atr(atr_period)
shouldSell = result == 0 and dayofweek == day_of_week
shouldBuy = result == 1 and dayofweek == day_of_week
plotshape(result == 0 and dayofmonth == day_of_week, title="sell", location=location.abovebar, color=color.red, transp=0, style=shape.arrowdown)
plotshape(result == 1 and dayofmonth == day_of_week, title="buy", location=location.belowbar, color=color.lime, transp=0, style=shape.arrowup)
strategy.entry("short entry", strategy.short, 1000 / (1*atr), when=shouldSell and year == year_to_test)
strategy.entry("long entry", strategy.long, 1000 / (1*atr), when=shouldBuy and year == year_to_test)
strategy.exit("exit", "long entry", limit = close + 1*atr, stop = close - 1*atr, when = shouldBuy)
strategy.exit("exit", "short entry", limit = close - 1*atr, stop = close + 1*atr, when = shouldSell)
Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-13. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Simple-Trading-Strategy-Based-on-Random-Luck.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.