この戦略は,取引の周期的な法則を中心に設計され,月曜日の尾盤で買い,水曜日の開盤前に止まり,退出し,その波段の価格動向の動きを捕捉する. 典型的な機械的取引戦略である.
戦略の原則:
毎週月曜日の閉店前には,買入操作を実行し,多頭ポジションを開きます.
毎週水曜日,取引開始前にストップを実行し,多頭ポジションを退出する.
損失を拡大しないように,ストップ・損失の割合を設定します.
ストップポイントを設定し,収益を固定します.
ストップ・ロスの線を描いて,利益と損失を直視的に表示する.
この戦略の利点は
周期的な取引方式は撤回リスクが低く,歴史上優れている.
規則は明確で,アルゴリズム化された取引の実行を容易にする.
ストップ・ストップ・損失の設定はシンプルで実用的です.
この戦略のリスクは
突発事件が周期パターンに与える影響に適応できない.
遅滞の停止 単一損失の拡大を制限できない.
収益を封じ込めると,その後の動きは追跡できない.
要するに,この戦略は,機械化された周期取引方式を採用し,反省効果は顕著ですが,周期パターンの突破に対応することは困難であり,投資家は慎重に使用する必要があります.
/*backtest
start: 2023-08-12 00:00:00
end: 2023-09-11 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © processingclouds
// @description Strategy to go long at end of Monday and exit by Tuesday close, or at stop loss or take profit percentages
//@version=5
strategy("Buy Monday, Exit Wednesday", "Mon-Wed Swings",overlay=true)
// ----- Inputs: stoploss %, takeProfit %
stopLossPercentage = input.float(defval=4.0, title='StopLoss %', minval=0.1, step=0.2) / 100
takeProfit = input.float(defval=3.0, title='Take Profit %', minval=0.3, step=0.2) / 100
// ----- Exit and Entry Conditions - Check current day and session time
isLong = dayofweek == dayofweek.monday and not na(time(timeframe.period, "1400-1601"))
isExit = dayofweek == dayofweek.wednesday and not na(time(timeframe.period, "1400-1601"))
// ----- Calculate Stoploss and Take Profit values
SL = strategy.position_avg_price * (1 - stopLossPercentage)
TP = strategy.position_avg_price * (1 + takeProfit)
// ----- Strategy Enter, and exit when conditions are met
strategy.entry("Enter Long", strategy.long, when=isLong)
if strategy.position_size > 0
strategy.close("Enter Long", isExit)
strategy.exit(id="Exit", stop=SL, limit=TP)
// ----- Plot Stoploss and TakeProfit lines
plot(strategy.position_size > 0 ? SL : na, style=plot.style_linebr, color=color.red, linewidth=2, title="StopLoss")
plot(strategy.position_size > 0 ? TP : na, style=plot.style_linebr, color=color.green, linewidth=2, title="TakeProfit")