この戦略は,ランダムな運に基づく簡単な取引戦略である.この戦略は,毎週最初の日に多額の多額の信号を発生させるランダムな方法を使用し,大量に繰り返されるテストによってランダムな取引の効果を評価する.
この戦略の交易論理は,非常に単純で,直感的です.
毎週月曜日にコインを投じると ランダムに表と裏が出る.
首ならその日に多く,尾ならその日に空いてください。
オーバーローの場合は,ストップロスが1倍ATR,ストップストップは1倍ATRと設定され,空白は同理で,1:1のリスク・リターン比率を実現する.
持株は今週末の平仓まで.
この戦略の利点は,膨大な年数を遡って,ランダムな取引の平均勝利率を評価できるという点にある.取引規則は極めて単純で,戦略の比較基準として用いられる.
しかし,ランダムな取引は市場規則を利用できないため,継続的に正の利益を得ることが困難である. ストップ・ストップ・損失の固定も損失の拡大を引き起こす可能性がある. 取引者は,実験的戦略としてのみ使用することができ,実体には使用できません.
総じて,データ反射はランダムな取引の効果を提示しますが,実用的な戦略を代表しません. 取引者は最終的に判断力とシステム的な取引技が必要になります.
/*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)