SchopplMarcus

Keltner Channel Strategy

552 views
51
552 3
Hello Friends,

i found here a Keltner Channel Strategy. But this Strategy trades LONG and SHORT.

Could some code it to long also.

If a sell condtion is true, so no short trades is initiated - only sell se long trade to be flat.

is it possible?

Thank you so much for your help!
Von Favorisierten Skripten entfernen Zu Favorisierten Skripten hinzufügen
Hello Friends, i found here a Keltner Channel Strategy. But this Strategy trades LONG and SHORT.

Could some code it for "Long signals only?

Thank you so much for your help!
+1 Antworten
ACNPaulraj SchopplMarcus
@SchopplMarcus, //@version=3
strategy("Keltner Channel Strategy", overlay=true)
source = close

useTrueRange = input(true)
length = input(20, minval=1)
mult = input(1.0)

ma = sma(source, length)
range = useTrueRange ? tr : high - low
rangema = sma(range, length)
upper = ma + rangema * mult
lower = ma - rangema * mult

crossUpper = crossover(source, upper)
crossLower = crossunder(source, lower)

bprice = 0.0
bprice := crossUpper ? high+syminfo.mintick : nz(bprice)

sprice = 0.0
sprice := crossLower ? low -syminfo.mintick : nz(sprice)

crossBcond = false
crossBcond := crossUpper ? true
: na(crossBcond) ? false : crossBcond

crossScond = false
crossScond := crossLower ? true
: na(crossScond) ? false : crossScond

cancelBcond = crossBcond and (source < ma or high >= bprice )
cancelScond = crossScond and (source > ma or low <= sprice )

if (cancelBcond)
strategy.cancel("KltChLE")

if (crossUpper)
strategy.entry("KltChLE", strategy.long, stop=bprice, comment="KltChLE")


//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
Antworten
No one here who can code this for "Long only" :-( ??? I´m new a Pince Editor Script :-(
Antworten
DE Deutsch
EN English
EN English (UK)
EN English (IN)
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
HE עברית
Startseite Aktien-Screener Devisen-Screener Krypto-Screener Wirtschaftskalender So funktioniert es! Chartmerkmale Hausregeln Moderatoren Webseite & Brokerlösungen Widgets Stock Charting Bibliothek Feature-Anfrage Blog & Nachrichten FAQ - Häufige Fragen & Antworten Hilfe & Wiki Twitter
Profil Profileinstellungen Konto und Abrechnung Meine Support Tickets Support kontaktieren Veröffentlichte Ideen Followers Ich folge Private Nachrichten Chat Abmelden