市場流動性と動向に基づいたスキルピング戦略

作者: リン・ハーンチャオチャン開催日:2024年1月30日15時36分33秒
タグ:

img

概要

この戦略は,短期的な取引戦略を実施するために,市場の流動性,傾向,技術指標を包括的に考慮する.この戦略は,市場流動性が比較的良好であるときにトレンドをフォローし,ポジションを開き,短期的な利益を得ることができます.

戦略原則

  1. 基本原則: この戦略は主に市場の流動性と傾向を考慮します.市場の流動性が良好でトレンドが現れるときに短期取引を行います.

  2. 市場流動性指標:この戦略は主にMFIと取引量の変化を市場流動性指標として使用します.MFIが上昇し取引量が上昇すると,市場の流動性がより良くなり,ポジションを開くのに適していると信じています.

  3. トレンド判断:この戦略は,ADX,EMAおよび他の指標を組み合わせてトレンドを決定します.ADXが30を超えると,そのEMAは,トレンドが比較的強いことを意味します.同時に,高速と遅いEMAの黄金の十字が発生した場合,トレンドも検証できます.

  4. 開始条件: 市場の流動性が良好で,同時にトレンドが現れるとき,他の補助条件 (SAR ポジション判断など) も満たされている場合,開始信号が生成されます.

  5. この戦略は,各取引に対して固定した利益 (10ポイント) とストップ損失 (7.5ポイント) を設定します.

利点分析

この戦略には以下の利点があります.

  1. タイミングを決めるのに市場流動性を利用する:市場流動性を決めるには,MFIと取引量に基づいて,市場の流動性が低いときにポジションを開設しないようにする.

  2. EMAと他の指標を組み合わせてトレンド方向を決定し,トレンド利益を得るのに役立ちます.

  3. 良いリスク管理: 取引毎の最大損失を効果的に制御するために,固定した利益とストップ損失を設定します.

  4. 比較的高い取引頻度: 短期戦略として,取引頻度は比較的高く,段階的に利益を蓄積するのに適しています.

  5. パラメータ最適化のための大きな空間:例えば,MAパラメータ,ストップ・ロスト,テイク・プロフィート設定は戦略のパフォーマンスを向上させるために最適化することができます.

リスク分析

この戦略にはいくつかのリスクもあります:

  1. リアル・トレーディング・スライップ・コントロールリスク:理論的なストップ・ロストとテイク・プロフィートは,実際の取引条件を完全に反映できない.リアル・トレーディングにおけるスライップは比較的大きい可能性があります.

  2. トレンドの誤判リスク:この戦略は,トレンドを決定するために複数の指標に依存していますが,失敗する可能性は依然としてあります.

  3. 過剰取引リスク: 短期戦略として,パラメータの設定が正しくない場合,過剰取引につながる可能性があります.

  4. 市場異常リスク: 市場の流動性が非常に低い場合や政策の変化の場合,この戦略は適切に機能しない可能性があります.

リスクは以下のような側面から 軽減できます

  1. ストップ・ロスの範囲を適正に緩め,実際の滑り要因を考慮する.

  2. 傾向判断の論理を最適化し,失敗の確率を減らすためにより多くの指標を導入する.

  3. オープンポジションの頻度制限を追加して,過剰取引を避ける.

  4. 市場状況に基づいてパラメータを柔軟に調整し,異常な状況に対処します.

最適化方向

この戦略の最適化方向には,以下が含まれます.

  1. トレンド判断を最適化し,判断をより正確にするためにより多くの指標を導入します.例えば,MACD指標を導入します.

  2. 最適なパラメータ組み合わせを見つけるために MA のサイクルパラメータを最適化します.

  3. ストップ・ロスを改善し,移動・ストップ・ロスを利用し,インターバル・ストップ・ロスを利用し,利益を得る戦略を確立する.

  4. 取引数に制限を加え,過度に高い取引頻度を避ける.例えば,1日に最大3回までポジションを開く.

  5. 市場流動性の指標をより良く探す.例えば,純流入指標を導入する.

  6. パラメータ最適化関数を追加して,最適なパラメータ組み合わせを見つけるためにパラメータを自動的に最適化します.

概要

この戦略は,市場流動性やトレンドなどの要因を包括的に考慮する.短期的に利益を得ることができる.従来のトレンド戦略と比較して,この戦略の最大の革新は,市場の流動性が低いときにポジションを開設しないようにするための市場流動性指標の導入である.それに応じて,この戦略には,特定の現実世界の制御リスクやトレンド判断の誤差リスクもあります.より多くの指標を導入し,パラメータを最適化し,リスク管理を通じて,この戦略を継続的に改善することができます.


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 2h
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/
// © trent777brown

//@version=5
strategy("scalping with market facilitation", overlay=true, margin_long=100, margin_short=100)


MFI0 = (high - low) / volume
MFI1 = (high[1] - low[1]) / volume[1]

MFIplus = MFI0 > MFI1
MFIminus = MFI0 < MFI1

//Current Trend-(Changed mean to trend)-revised
trendplus = hl2 > high[1]
trendzero = hl2 < high[1] and hl2 > low[1]  //addition of script
trendminus = hl2 < low[1]  //changed high to low

//Volume +/-
volplus = volume > volume[1]
volminus = volume < volume[1]

//Period Control by Buyers or Sellers is determined with reference to Price action of the period 
//divided into 3 sectors, sector 1 is the Top third, Sector 2 is the middle third, 
//and sector 3 is the Bottom third of the period. Control classifications are: Extremes(11, 33), Neutral(22), 
//Climbers(31,21,32) Open lower than Close, and Drifters(13,23,12)Close lower than Open

//value0 = low
//value1 = ((high - low)/3)
//value2 = ((high - low)/3)*2
//value3 = high

//o1 = (open >= (((high - low)/3) * 2) + low)
//c1 = (close >= (((high - low)/3) * 2) + low)
//o2 = (open <= o1) 
//c2 = (close <= c1)
//o3 = (open <= ((high - low)/3) + low)
//c3 = (close <= ((high - low)/3) + low)

//sector2 = if((high - low)/3) + low and sector2 <= (((high - low)/3)*2) + low

//sector3 = if((high - low)/3) + low and >= low


//Extremes-Full Control of Period by Buyers or Sellers 
//pg79 notes an 85% chance that the current trend will change in the next 1 to 5 bars
b11 = open >= (high - low) / 3 * 2 + low and close >= (high - low) / 3 * 2 + low  //Extreme Buyer Control:Chartruse
b33 = open <= (high - low) / 3 + low and close <= (high - low) / 3 + low  //Extreme Seller Control:Crimson
//Neutral pg80
b22 = open >= (high - low) / 3 + low and open <= (high - low) / 3 * 2 and close >= (high - low) / 3 + low and open <= (high - low) / 3 * 2  //Bracketed Price Control
//Climber-Open lower than Close pg81
b31 = open <= (high - low) / 3 + low and close >= (high - low) / 3 * 2 + low  //Strong Buyer Control:Dark Green
b21 = open >= (high - low) / 3 + low and open <= (high - low) / 3 * 2 and close >= (high - low) / 3 * 2 + low  //Moderate Buyer Control:Green
b32 = open <= (high - low) / 3 + low and close >= (high - low) / 3 + low and open <= (high - low) / 3 * 2  //Weak Buyer Control:Light Green
//Drifter-Close lower than Open pg81
b13 = open >= (high - low) / 3 * 2 + low and close <= (high - low) / 3 + low  //Strong Seller Control:Dark Red
b23 = open >= (high - low) / 3 + low and open <= (high - low) / 3 * 2 and close <= (high - low) / 3 + low  //Moderate Seller Control:Red
b12 = open >= (high - low) / 3 * 2 + low and close >= (high - low) / 3 + low and open <= (high - low) / 3 * 2  //Weak Seller Control:Light Red/Pink

 

//


psar= ta.sar(.09, .2, .2)

ema8= ta.ema(hlc3, 8)

ema13h= ta.ema(high, 13)
ema13l= ta.ema(low, 13)
ema13= ta.ema(close, 13)

ema55= ta.ema(close, 100)

[dip, dim, adx]= ta.dmi(5, 5)
adxema=ta.ema(adx, 3)
[macdl, sigl, histl]= ta.macd(close, 8, 13, 5)
obv= ta.obv
obvema= ta.ema(obv, 8)
obvema55= ta.ema(obv, 55)
mfigreen= MFIplus and volplus
adx_x_over= ta.crossover(adx, adxema) and adx >= 25
barssincemfi= ta.barssince(mfigreen)










longtrig2= adx > 30 and adx > adxema and barssincemfi <= 4 


shorttrig2= adx > 30 and adx > adxema and barssincemfi <= 4 


long= macdl > sigl and obv > obvema55 and ema8 > ema55   and psar < low and trendplus//and ema13l > ema55//and open > hull200 and close > hull200

short= macdl < sigl and obv < obvema55 and ema8 < ema55 and psar > high and trendminus//and ema13h < ema55//open < hull200 and close < hull200


//plot(hull200, color=color.red, linewidth=3)
plot(ema13h, color=color.gray, linewidth=3)
plot(ema13l, color=color.gray, linewidth=3)

plot(ema13, color=color.blue, linewidth=3)
//
plot(ema55, color=color.white, linewidth=3)
plot(psar, color=color.white, style=plot.style_circles)
plotshape(mfigreen, color=color.yellow, style=shape.flag, location=location.belowbar, size= size.tiny)
longCondition = long
if (longCondition)
    strategy.entry("My Long Entry Id", strategy.long, 1,  when= longtrig2)
    strategy.exit("exit long", "My Long Entry Id", profit= 100, loss= 75)
shortCondition = short
if (shortCondition)
    strategy.entry("My Short Entry Id", strategy.short, 1,  when= shorttrig2)
    strategy.exit("exit short", "My Short Entry Id", profit= 100, loss= 75)


もっと