逆オープンエングルフィング戦略


作成日: 2023-11-22 16:05:24 最終変更日: 2023-11-22 16:05:24
コピー: 1 クリック数: 615
1
フォロー
1617
フォロワー

逆オープンエングルフィング戦略

概要

リバース・オープン・サボット・ストラテジーとは,株式の最初のKラインをベースにした簡単な日中取引戦略である.この戦略の核心構想は,毎日のオープンの後に最初のKラインが現れたときに,その上昇方向を判断し,逆操作を行うことである.最初のKラインが赤の陽線であれば,多く行い,最初のKラインが緑の陰線であれば,空にする.この戦略は,同時に止損と止まりの出場機構を設定している.

戦略原則

この戦略の原理は,開盤後の最初の根K線の特殊性に基づいている.開盤時に,多空の両側の力が対戦する最強で,情勢が逆転する確率は大きい.最初の根K線の下降方向を判断し,逆の道を行くことは,この戦略の核心思想である.

具体的には,新しい日の開盤後,戦略は,最初のK線の開盤価格,閉盤価格および下落を記録する.開盤価格が閉盤価格 (緑の陰線) よりも高く,空頭勝利を表す場合は,多;開盤価格が閉盤価格 (赤の陽線) よりも低く,多頭勝利を表す場合は,空空する.このような逆操作によって,戦略は開盤後の反転の機会を捕獲しようとします.

同時に,戦略は,多額のストップ価格,多額のストップ価格,空白のストップ価格と空白のストップ価格を含む,多額の空白のポジションのリスクと利益の制御をするために,過度の損失や早期の切断を避けるために,ストップとストップメカニズムを設定しています.

優位分析

逆開盤の策略は以下の利点があります.

  1. シンプルで明快で,理解し,実行しやすい.

  2. 営業時間の高い予測値の特性を利用して,反転の機会を掴む.

  3. ストップ・ストップを設定することで,リスクを効果的にコントロールできます.

  4. 戦略的思考は普遍的で,ほとんどの株式に適用されます.

  5. 参加費が低く 資金管理が簡単です

リスク分析

逆開盤・吞食戦略にはリスクがあります.

  1. 開盤反転失敗の確率.もし最初のK線の反転信号が失敗すれば,大きな損失を引き起こす可能性がある.

  2. 低品質の個人を効果的にフィルターできない.この戦略は,株の基本面分析が不足し,基本面が悪いいくつかの不良株が選択される可能性がある.

  3. 重要な負のニュースの影響など,突発的な事件のシステム上のリスクを効果的に制御できないこと

  4. ストップ・ロスト・フードが正しく設定されていない場合,損失が拡大したり,利益が縮小したりする可能性があります.

最適化の方向

リバース ディスク・エーブ戦略は,以下の点で最適化できます.

  1. 開盤反転信号の有効性検査を追加し,無効信号を回避する.例えば,合成交差量分析を統合する.

  2. 株の基本面と技術指標を組み合わせて,株池の優良選択を行い,低品質の個人株をフィルタリングする.

  3. 大事な事件やニュースを監視するモジュールを追加し,システム上のリスクを制御する.

  4. 遺伝的アルゴリズム,機械学習などの方法を用いて,止損停止の設定を動的に最適化する.

要約する

逆開盤吞食戦略は,開盤後の反転の機会をつかむために,最初のK線の方向を判断し,逆操作を行う.この戦略は,考え方はシンプルで,参加コストは低く,実用的な価値があります.しかし,我々は,そのリスクを認識し,実践で継続的に改善し,戦略を最適化し,より安定して信頼性のあるようにする必要があります.

ストラテジーソースコード
/*backtest
start: 2023-10-22 00:00:00
end: 2023-11-21 00:00:00
period: 3h
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/
// © vikris
//@version=4
strategy("[VJ]First Candle Strategy", overlay = true,calc_on_every_tick = true,default_qty_type=strategy.percent_of_equity,default_qty_value=100,initial_capital=750,commission_type=strategy.commission.percent, 
     commission_value=0.02)


// ********** Strategy inputs - Start **********

// Used for intraday handling
// Session value should be from market start to the time you want to square-off 
// your intraday strategy
// Important: The end time should be at least 2 minutes before the intraday
// square-off time set by your broker
var i_marketSession = input(title="Market session", type=input.session, 
     defval="0915-1455", confirm=true)

// Make inputs that set the take profit % (optional)
longProfitPerc = input(title="Long Take Profit (%)",
     type=input.float, minval=0.0, step=0.1, defval=1) * 0.01

shortProfitPerc = input(title="Short Take Profit (%)",
     type=input.float, minval=0.0, step=0.1, defval=1) * 0.01
     
// Set stop loss level with input options (optional)
longLossPerc = input(title="Long Stop Loss (%)",
     type=input.float, minval=0.0, step=0.1, defval=0.5) * 0.01

shortLossPerc = input(title="Short Stop Loss (%)",
     type=input.float, minval=0.0, step=0.1, defval=0.5) * 0.01    


// ********** Strategy inputs - End **********


// ********** Supporting functions - Start **********

// A function to check whether the bar or period is in intraday session
barInSession(sess) => time(timeframe.period, sess) != 0



// Figure out take profit price
longExitPrice  = strategy.position_avg_price * (1 + longProfitPerc)
shortExitPrice = strategy.position_avg_price * (1 - shortProfitPerc)

// Determine stop loss price
longStopPrice  = strategy.position_avg_price * (1 - longLossPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortLossPerc)


// ********** Supporting functions - End **********


// ********** Strategy - Start **********
// See if intraday session is active
bool intradaySession = barInSession(i_marketSession)

// Trade only if intraday session is active

//=================Strategy logic goes in here===========================
 
// If start of the daily session changed, then it's first bar of the new session
isNewDay = time("D") != time("D")[1]
var firstBarCloseValue = close
var firstBarOpenValue = open
if isNewDay
    firstBarCloseValue := close
    firstBarOpenValue := open


greenCandle = firstBarOpenValue < firstBarCloseValue
redCandle = firstBarOpenValue > firstBarCloseValue

buy = redCandle
sell = greenCandle


// plot(firstBarCloseValue)
// plot(firstBarOpenValue)



//Final Long/Short Condition
longCondition = buy
shortCondition =sell
 
//Long Strategy - buy condition and exits with Take profit and SL
if (longCondition and intradaySession)
    stop_level = longStopPrice
    profit_level = longExitPrice
    strategy.entry("My Long Entry Id", strategy.long)
    strategy.exit("TP/SL", "My Long Entry Id", stop=stop_level, limit=profit_level)


//Short Strategy - sell condition and exits with Take profit and SL
if (shortCondition and intradaySession)
    stop_level = shortStopPrice
    profit_level = shortExitPrice
    strategy.entry("My Short Entry Id", strategy.short)
    strategy.exit("TP/SL", "My Short Entry Id", stop=stop_level, limit=profit_level)
 
 
// Square-off position (when session is over and position is open)
squareOff = (not intradaySession) and (strategy.position_size != 0)
strategy.close_all(when = squareOff, comment = "Square-off")

// ********** Strategy - End **********