Random Entry Point Strategy
Random Entry Point Trading Strategy The Random Entry Point trading strategy uses randomly generated integers to determine entries for long and short trades. This strategy adheres to the golden rule of trading: "Let…
Random Entry Point Trading Strategy
The Random Entry Point trading strategy uses randomly generated integers to determine entries for long and short trades. This strategy adheres to the golden rule of trading: "Let profits rise and cut losses quickly".
The principles of this strategy are:
Set a random integer, e.g. 6.
Every time a new candle forms, take the current volume modulo the random integer to get a random number between 0-5.
Split 0-5 into two halves, 0-2 for long trades, 3-5 for short trades.
If the random number falls between 0-2 and there is no current position, go long. If it falls between 3-5 and there is no position, go short.
Set a stop loss and take profit after entering trades, e.g. -5% SL, 15% TP. Wait for SL/TP to trigger.
Clear positions after SL/TP is hit, and wait for next random signal.
Repeat steps 1-6 to continuously take random long/short positions.
Law of large numbers ensures profitability in the long run, SL controls risk.
The advantages of this strategy are simplicity of implementation, no need to predict market direction, long term profitability by following random signals. However, the randomness also introduces some risk, potentially large losses in the short term requiring sufficient capital. Parameters like SL/TP also significantly impact performance and need careful backtesting for optimization.
In summary, the Random Entry Point strategy relies on law of large numbers for profitability, uses SL/TP to control risk, suitable for investors with sufficient capital for long term use.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 6 | Random integer |
| v_input_2 | -5 | Stop loss |
| v_input_3 | 15 | Take profit |
Source Pine Script
/*backtest
start: 2022-09-11 00:00:00
end: 2023-04-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
// strategy(title="Random entry points",overlay=true, default_qty_type=strategy.cash, default_qty_value=500, currency="USD", initial_capital = 1000, commission_type=strategy.commission.percent, commission_value=0.07)
i = input(defval = 6, title = 'Random integer', type = input.integer)
stop_loss = input(defval = -5, title = 'Stop loss', type = input.integer)
take_profit = input(defval = 15, title = 'Take profit', type = input.integer)
random = volume % i
trade_area = float(i) / 2
var profit = 0.0
var start_price = 0.0
var in_deal = false
if not in_deal
profit := 0.0
if random < trade_area and not in_deal
in_deal := true
start_price := close
strategy.entry("long", true)
if in_deal
profit := (close / start_price -1) * 100
if profit < stop_loss or profit > take_profit
strategy.close("long")
in_deal := falsePublished by ChaoZhang on the FMZ strategy square · last modified 2023-09-12. 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/Random-Entry-Point-Strategy.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.