Bu örnek kod sizin için oluşturuldu, böylece TradingView'deki ilk işlem botunuzun otomasyonunu kontrol edebilirsiniz.
TradingView Bot Çalışması, hem Uzun hem de Kısa pozisyonları içerir.
Bu strateji, bir önceki mum sırasında varlığın fiyatı artmışsa (kapanış fiyatı açılış fiyatından yüksekse) uzun pozisyona girer ve varlığın fiyatı önceki mum sırasında düşerse (kapanış fiyatı, açılış fiyatından daha düşükse) uzun pozisyondan çıkar. Kısa pozisyon için bunun tersi geçerlidir. Bu nedenle, uzun pozisyondan çıkış sinyali yürütüldüğünde, otomatik olarak kısa pozisyona girişi tetikleyecektir. Bu kod herhangi bir zaman dilimine ve herhangi bir varlığa uygulanabilir.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Wunderbit Trading (WBT)
//@version=5
indicator("Signal Tester", overlay=true)
///////////////// LONG //////////////////
isEntry_Long = false
isEntry_Long := nz(isEntry_Long[1], false)
isExit_Long = false
isExit_Long := nz(isExit_Long[1], false)
entry_long = not isEntry_Long and close>open
exit_long = not isExit_Long and open>close
if (entry_long)
isEntry_Long := true
isExit_Long := false
if (exit_long)
isEntry_Long := false
isExit_Long := true
///////////// SHORT //////////////
isEntry_Short = false
isEntry_Short := nz(isEntry_Short[1], false)
isExit_Short = false
isExit_Short := nz(isExit_Short[1], false)
entry_short=not isEntry_Short and open>close
exit_short= not isExit_Short and close>open
if (entry_short)
isEntry_Short := true
isExit_Short := false
if (exit_short)
isEntry_Short := false
isExit_Short := true
alertcondition(entry_long, title="Enter Long")
alertcondition(exit_long, title="Exit Long")
alertcondition(entry_short, title="Enter Short")
alertcondition(exit_short, title="Exit Short")
plotshape(series=entry_long, text="Long", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(series=exit_long, text="EXIT Long",style=shape.triangledown, location=location.abovebar, color=color.purple, size=size.small)
plotshape(series=entry_short, text="Short", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
plotshape(series=exit_short, text="EXIT Short",style=shape.triangleup, location=location.belowbar, color=color.purple, size=size.small)
Not
Wunderbit'te Webhook bildirimlerini alabilmek için TradingView Pro aboneliğine ihtiyacınız var. TradingView'e şimdi kaydolun.