この戦略は2日間の閉盘価格差を分析し,将来の価格運動の方向を判断し,ショートライン取引を実現する.戦略はシンプルで直感的で,実行しやすい,ショートライントレーダーに適している.
この戦略の核心的な論理は,今日の閉店価格と昨日の閉店価格を比較することです.
ここで鍵となるのは,合理的な値の設定である.値が大きすぎると,より小さな価格変動が逃れ;値が小さすぎると,正常な変動により不合理な取引が多く発生する.戦略は,調整可能な値の設計を採用し,デフォルト値は0.004で,ステップ長さは0.001で,歴史的なデータに基づいてテストして適切な値を選択できます.
全体として,この戦略は,連続した2つの取引日の間の価格の変化を捉え,値フィルターによる正常な波動をフィルターし,将来の潜在的な価格傾向の方向を判断し,短線取引を行う.戦略の考え方はシンプルで直感的で,容易に理解し,実行する.
これらのリスクに対処するには,次のことを考慮する必要があります.
この戦略は以下の方向から最適化できる:
複数の時間周期の回測- 異なる時間周期 (日線,4時間,1時間など) を用いて,最適の時間周期とパラメータを選択する.
波動率指数と組み合わせた- ATRのような価格変動を考慮する指標を追加することで,動的値の構築がより良くなる.
ストップダストロジック- 合理的なストップポイントを設定して,単発損失を制御する.
ポジション管理の最適化- ポジションのサイズと加仓規則の最適化,損失を抑えて利潤を上げる.
取引コストを考慮する- 取引手数料,スライドポイントなどの取引コストの考慮を反測に追加し,反測を実物に近いものにします.
機械学習を導入する- 機械学習アルゴリズムを適用し,より多くの特性を抽出し,より強力な取引シグナルを構築する.
この戦略は,閉盤価格差を基に将来の価格トレンドを判断し,シンプルで直感的な考え方を採用して,ショートライン取引戦略を設計する.戦略は,実行しやすい,ショートライン操作に適しているが,一定損失のリスクがある可能性がある.複数の最適化手段によって,戦略の安定性と収益性を向上させることができる.この戦略は,基礎戦略として,さらなる研究のための考え方を提供し,参照することができる.
/*backtest
start: 2023-08-28 00:00:00
end: 2023-09-27 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy("Daily Close Comparison Strategy (by ChartArt) repainting results", shorttitle="CA_-_Daily_Close_Strat", overlay=false)
// ChartArt's Daily Close Comparison Strategy
//
// Version 1.0
// Idea by ChartArt on February 28, 2016.
//
// This strategy is equal to the very
// popular "ANN Strategy" coded by sirolf2009,
// but without the Artificial Neural Network (ANN).
//
// Main difference besides stripping out the ANN
// is that I use close prices instead of OHLC4 prices.
// And the default threshold is set to 0 instead of 0.0014
// with a step of 0.001 instead of 0.0001.
//
// This strategy goes long if the close of the current day
// is larger than the close price of the last day.
// If the inverse logic is true, the strategy
// goes short (last close larger current close).
//
// This simple strategy does not have any
// stop loss or take profit money management logic.
//
// List of my work:
// https://www.tradingview.com/u/ChartArt/
//
// __ __ ___ __ ___
// / ` |__| /\ |__) | /\ |__) |
// \__, | | /~~\ | \ | /~~\ | \ |
//
//
threshold = input(title="Price Difference Threshold repainting results", type=float, defval=0.004, step=0.001)
getDiff() =>
yesterday=security(syminfo.tickerid, 'D', close[1])
today=security(syminfo.tickerid, 'D', close)
delta=today-yesterday
percentage=delta/yesterday
closeDiff = getDiff()
buying = closeDiff > threshold ? true : closeDiff < -threshold ? false : buying[1]
hline(0, title="zero line")
bgcolor(buying ? green : red, transp=25)
plot(closeDiff, color=silver, style=area, transp=75)
plot(closeDiff, color=aqua, title="prediction")
longCondition = buying
if (longCondition)
strategy.entry("Long", strategy.long)
shortCondition = buying != true
if (shortCondition)
strategy.entry("Short", strategy.short)