ABD Doları / Japon Yeni
Eğitim
Güncellendi

Pine講座㊺ バックテスト|Consecutive Up/Down Strategy の解説

2221
連続陽線・連続陰線で途転売買していくストラテジーです。

これで、内蔵のストラテジーはすべて完了です!

次回以降は、サードパーティのものを確認して、
Pine講座もそろそろお終いですね。

※ TradingView内蔵のストラテジーを
  上から順番に解説しています

※ 解説はコードの中で

※ コピペする場合は以下の変更を行ってください
[](全角の角括弧)→(半角の角括弧)
(全角スペース)→(半角スペース)

=====
//version=4
strategy( "Consecutive Up/Down Strategy の解説", overlay=false )

//連続の数を設定
consecutiveBarsUp = input(3)
consecutiveBarsDown = input(3)

price = close

//連続上昇をカウント
ups = 0.0
ups := price > price[1] ? nz(ups[1]) + 1 : 0

//連続下降をカウント
dns = 0.0
dns := price < price[1] ? nz(dns[1]) + 1 : 0

//連続上昇が設定値以上のとき
if (ups >= consecutiveBarsUp)
//買いエントリー
strategy.entry("ConsUpLE", strategy.long, comment="ConsUpLE")

//連続下降が設定値以上のとき
if (dns >= consecutiveBarsDown)
//売りエントリー
strategy.entry("ConsDnSE", strategy.short, comment="ConsDnSE")

plot( ups ,color=color.red )
plot( dns ,color=color.blue )
=====
Not
次の講座
Pine講座㊻ バックテスト|GetTrendStrategy(win% 88、RR 4)
Not
次の講座
Pine講座㊼ バックテスト|20 years old Turtles strategy still work!! の解説

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.