月曜に買い 水曜に売る 取引戦略

作者: リン・ハーンチャオチャン, 日時: 2023-09-12 16:44:53
タグ:

この戦略は,月曜の閉店でロングに入って,この期間の価格変動を把握するために水曜日の開店前に利益を得ることで,週間の周期的なパターンを取引します.これは典型的な機械システムです.

戦略論理:

  1. 毎週月曜に 長いエントリを実行します

  2. 毎週水曜日の営業前に 利益を得て退場します

  3. ストップ損失パーセントを 制限損失に設定します

  4. 利益の目標パーセントを設定します

  5. グラフストップと利益線は視覚的なP&Lです

利点:

  1. 周期的な取引は 引き上げが少なく 業績も良好です

  2. 固定ルール 自動化や実行が簡単

  3. シンプルなストップ・ロストと 利益の設定です

リスク:

  1. サイクルを乱す出来事には適応できない

  2. 遅延ストップ損失 単一の取引での損失を制限することはできません.

  3. 利益に閉じ込められ 更に上昇を追いつくことはできません

概要すると,この機械的な周期的なシステムには印象的なバックテストがありますが,パターンが変化すると適応するのに苦労します.投資家は慎重に裁量する必要があります.


/*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")

もっと