日々の閉店価格比較戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-17 18:28:31
タグ:

概要

この戦略は,現在のバーの閉じる価格と前のバーの閉じる価格を比較することによって方向性を決定する.これは,価格が上昇すると長引,価格が下がると短引する簡単なトレンドフォロー戦略である.複雑な指標は不要であり,最も基本的な価格情報だけがトレンド方向性を決定するために使用される.

戦略の論理

  1. 現在のバーの閉店価格と前のバーの閉店価格の割合差を計算する.

  2. 値が値を超えると 値上がりを示します

  3. 値がマイナスなら 値下がりです ショートです

  4. 値引きは0で 値引きが上がるとロングで 値引きが下がるとショートです

  5. ストップ・ロスト・ロジックも 利益の引き上げもなく 利潤はトレンド持続にのみ 依存する

利点分析

  1. シンプルで直感的なトレンド決定方法で 分かりやすく実行できます

  2. 技術指標の計算は必要なく,資源の消費を減らす.

  3. 基本価格情報だけに集中し,不必要な指標の騒音を避ける.

  4. バックテストの結果は優秀だが ライブでのパフォーマンスは疑わしい

リスク分析

  1. ストップ・ロスは無制限の損失を招く

  2. 市場が不安定で 罠にかかったりします

  3. オーバーフィッティングリスクは存在し ライブパフォーマンスはまだ検証されていません

  4. 純粋なトレンドに従うことで 利益は確保できません 利益は限られています

オプティマイゼーションの方向性

  1. リスク管理のためにストップロスを追加します.

  2. 不安定な市場における不安定性を減らすための 変動対策を導入する

  3. 耐久性を高めるため,異なる周期パラメータをテストする.

  4. 傾向決定指標を追加して不合理な価格変動を避ける.

  5. 利潤の可能性を拡大するために最高価格を考慮して利益を最適化します

概要

この戦略の基本理念はシンプルですが,実用的なパフォーマンスは疑問に思われます.実際の適用前に,より強力なリスク管理メカニズムとパラメータ最適化テストが必要です.しかし,基本的な概念は学ぶ価値があります.


/*backtest
start: 2023-08-17 00:00:00
end: 2023-09-16 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
strategy("Daily Close Comparison Strategy (by ChartArt)", 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", type=float, defval=0, 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)

もっと