
この戦略は,水平線を支給と抵抗として使用し,価格が水平線を破るときに取引シグナルを生成する.主な考え方は,まず,いくつかの条件に基づいて水平線を描く.価格が上方から水平線を突破するとき,より多くのことをし,価格が下方から水平線を突破したとき,平仓する.同時に,水平線の生成は,前回のK線の最低価格が現在の閉盘価格より大きい場合,同様の条件があります.
この戦略は,水平線を重要な支柱の抵抗点として,水平線を突破することで取引信号を生成する.利点は,論理が単純で,実行が容易で,トレンドをうまく捉えることができる点である.しかし,欠点は,過度取引が起こり,誤った信号を生成し,空白をすることができない点である点である.その後,他の指標を組み合わせ,取引頻度を減らす,空白メカニズムと動態調整パラメータを組み込むなどから最適化および改善することができる.
/*backtest
start: 2023-04-20 00:00:00
end: 2024-04-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Traderxprox
//@version=5
strategy("Alarm Trader_ALL", overlay=true)
// Yatay çizgi oluşum
yatayc = low[1] > close[0]
if yatayc
if strategy.opentrades > 0
strategy.close("AL", comment = "Fiyat:" + str.tostring(low[1], "#.##") + "\n" + timeframe.period +"\n Yatay Direnç Oluştu")
else
strategy.entry("AL", strategy.long, comment = "Fiyat:" + str.tostring(low[1], "#.##") + "\n" + timeframe.period +"\n Yatay Direnç Oluştu")
//YATAY ÇİZGİ
int cizgilen = input.int(20, "Çizgi uzunluğu?", group = "Yatay Çizgi Ayarları")
var array<line> lines = array.new<line>()
int numberOfLines = input.int(10, "Son Kaç Çizgi?", 0, group = "Yatay Çizgi Ayarları")
kural22 = low[1] > close[0]
// if kural22
// newLine = line.new(bar_index-2, low[1], bar_index+cizgilen, low[1] ,color=color.red, width=1, style=line.style_solid)
// // Push the `newLine` into the `lines` array.
// lines.push(newLine)
// // Delete the oldest line when the size of the array exceeds the specified `numberOfLines`.
// if array.size(lines) > numberOfLines
// line.delete(lines.shift())
// Alarm kırılım için koşul
var float lastLinePrice = na
if not na(close) and array.size(lines) > 0
lastLinePrice := line.get_price(array.get(lines, array.size(lines) - 1), bar_index)
if open < lastLinePrice and close > lastLinePrice
if strategy.opentrades > 0
strategy.close("AL", comment = "Fiyat:" + str.tostring(lastLinePrice, "#.##") + "\n" + timeframe.period +" \n Yatay çizgi yukarı kırılımı")
else
strategy.entry("AL", strategy.long, comment = "Fiyat:" + str.tostring(lastLinePrice, "#.##") + "\n" + timeframe.period +" \n Yatay çizgi yukarı kırılımı")