日次終値比較戦略


作成日: 2023-09-17 18:28:31 最終変更日: 2023-09-17 18:28:31
コピー: 3 クリック数: 630
1
フォロー
1617
フォロワー

概要

この戦略は,現在のK線の閉盘価格と前日の閉盘価格を比較して,多空方向を判断する. 価格が上昇すると多,下落すると空をする,単純なトレンド追跡戦略である. 複雑な指標判断を必要とせず,最も基本的な価格情報によってトレンド方向を判断する.

戦略原則

  1. 現在のK線の閉店価格と前日の閉店価格の差の比率を計算する.

  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)