UDAY_C_Santhakumar

TSM Donchian Moving Average System_by_ucsgears

This is just the raw code for the system / strategies.

Will Complete this when I get more time.

Green - Setup Long
Red - Setup Short

Uday C Santhakumar
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
study("TSM Donchian Moving Average System", overlay = true)

a = input(20, title = "Long Period")
b = input(5, title = "Short Period")
ca = input(1, title = "Band Factor")

// Moving average
malong = sma(close,a)
mashort = sma(close,b)
range = sma(tr, a)*ca
kclupper = malong + range
kcllower = malong - range

kcsupper = mashort + range
kcslower = mashort - range


// PLOT
plot(malong, offset=1, title = "SMA Long")
plot(mashort, offset=1, title = "SMA Short")
plot(kclupper, offset=1, title = "KC Upper")
plot(kcllower, offset=1, title = "KC Lower")

// SETUP 
// LONG 
setuplong = close > kclupper[1] and close > kcsupper[1] ? green : na
setupshort = close < kcllower[1] and close < kcslower[1] ? red : na

barcolor(setuplong)
barcolor(setupshort)

// EXIT
// LONG
//exitlong = close < kclupper[1] and close < kcsupper[1] ? blue : na
//exitshort = close > kcllower[1] and close > kcslower[1] ? orange : na

//barcolor(exitlong)
//barcolor(exitshort)