soru

soru dynamics®

578 4 76
Hi
this is reworked version dynamics indicator I published earlier. Now it's automatic - no input required.
It shows current TF bias and also longer term bias. Just choose TF and see how it draws channels.

My favourite TFs I use with that indicator are: 1m, 5m, 15m, 2h, 1D

Have fun and let me know what do you think about it.

Cheers
soru
Remove from Favorite Scripts Add to Favorite Scripts
study(title="soru dynamics®", shorttitle="soru dynamics®", overlay=true)
//input
periods=200
k = ismonthly? "M" : isweekly? "W" : isdaily ? "D" : ""
TW1 = tostring(interval)+k 
TW2 = tostring(interval*8)+k
s_TW1 = input(defval=true, title='Render TW1 Dynamics')
s_TW2 = input(defval=true, title='Render TW2 Dynamics')

// script
lvl(x) =>
    sma_l = security(tickerid, x, sma(low, periods))
    sma_h = security(tickerid, x, sma(high, periods))
    sma_m = sma_l+(sma_h-sma_l)/2
    k = close >= sma_m ? 1 : -1
    cond = sma_h-sma_l
    a = k > 0 ? ((abs(close - sma_h)/cond)/2.5) : ((abs(close - sma_l)/cond)/2.5)     
    m_1 = round(a)*2.5
    m_2 = round(a)*2.5+2.5
    m_3 = round(a)*2.5-2.5
    l = round(a)*2.5 < 5 ? sma_l : na
    h = round(a)*2.5 < 5 ? sma_h : na
    j= k==1 ? sma_h : sma_l
    lvl1 = j + k*m_1*cond
    lvl2 = j + k*m_2*cond
    lvl3 = j +k*m_3*cond
    [l, h, lvl1,lvl2,lvl3]

lc = security(tickerid, TW2, sma(low, periods))
hc = security(tickerid, TW2, sma(high, periods))
TW1_col = close > hc ? #579951 : close < lc ? #ca3925 : #747258    
TW2_col = black
[l1,h1, u1,u2,u3] = lvl(TW1)
plot_l1=plot(s_TW1 ? l1 : na, style=circles, color = TW1_col)
plot_h1=plot(s_TW1 ? h1 : na, style=circles, color = TW1_col)
plot(s_TW1 ? u1 : na, style=circles, color = TW1_col)
plot(s_TW1 ? u2 : na, style=circles, color = TW1_col)
plot(s_TW1 ? u3 : na, style=circles, color = TW1_col)
fill(plot_l1,plot_h1,transp=70,color=gray)
[l2, h2, d1, d2, d3] = lvl(TW2)
plot_l2=plot(s_TW2 ? l2 : na, style=circles, color= TW2_col)
plot_h2=plot(s_TW2 ? h2 : na, style=circles, color= TW2_col)
plot(s_TW2 ? d1 : na, style=circles, color= TW2_col)
plot(s_TW2 ? d2 : na, style=circles, color= TW2_col)
plot(s_TW2 ? d3 : na, style=circles, color= TW2_col)
fill(plot_l2,plot_h2,transp=70,color=gray)
wow... beautiful
Reply
Very smart coding, thanks for sharing.
+1 Reply
soru IvanLabrie
thank you
Reply
soru IvanLabrie
first version of this indicator had 200+ lines:) it worked slowly. Now I've added few things to this indicator and managed to close within 46 lines:) Still learning pine but I'm getting better and better. By the way if anyone know how to read certain value onload instead of rereading it with each candle that is drawn on chart - do let me know.
+2 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out