ucsgears

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
Remove from Favorite Scripts Add to Favorite Scripts
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)
TASAVANT
2 years ago
Looks good, this system is a steady performer
Reply
ucsgears PRO TASAVANT
2 years ago
Thanks for Sharing.
Reply
ucsgears PRO
2 years ago
snapshot

snapshot


New and improved update, with better filters.
Reply
P7 ucsgears
2 years ago
Thank you very much for sharing ucsgears, did you use RSI as filter this time by any chance ?
Reply
ucsgears PRO P7
2 years ago
no. Its just different overlay indicators to serve the same purpose.
Reply
mahatango747
3 days ago
How do you activate the Exit Long section? For some reason the short side of the code doesn't work.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out