synapticEx

Nebula Advanced Dynamic Support/Resistance

Still I don't know. Maybe it was not the script, but a bug in trading view that seems to appear when one reach the maximum jackpot: http://imgur.com/5FxvjjL
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
//synapticex.com
study("Nebula", shorttitle="Nebula", overlay=true)
length = input(title="Length", type=integer, defval=20)

fractal(i, type)=>
    f = 0
    if(type == 1 and n>15)
        f := high[i]<high[i-1] and high[i-1]<high[i-2] and high[i-2]>high[i-3] and high[i-3]>high[i-4] ? 1 : 0
    if(type == 2 and n>15)
        f := low[i]>low[i-1] and low[i-1]>low[i-2] and low[i-2]<low[i-3] and low[i-3]<low[i-4] ? 1 : 0
    f
    
h = fractal(5, 1)
l = fractal(5, 2)
hVal =  h ? high[3] : 0
lVal = l ? low[3] : 0

lSum = n>length*2 ? sum(lVal, length) : 0
hSum = n>length*2 ? sum(hVal, length) : 0
lN = n>length*2 ? sum(l, length) : 0
hN = n>length*2 ? sum(h, length) : 0
r = lSum>0 and hSum>0 and lN>0 and hN>0 ? abs((hSum/hN) - (lSum/lN)): 0

hPlus = hVal  and r?hVal+r:na
hMinus = hVal  and r?hVal-r:na
lPlus = lVal  and r?lVal+r:na
lMinus = lVal  and r?lVal-r:na
    
plot(hPlus, "hPlus", color=lime, linewidth=1, style=cross, transp=0, offset =-3, join=false)
plot(hMinus, "hMinus", color=red, linewidth=1, style=cross, transp=0, offset=-3, join=false)

plot(lPlus, "lPlus", color=white, linewidth=1, style=cross, transp=0, offset =-3, join=false)
plot(lMinus, "lMinus", color=fuchsia, linewidth=1, style=cross, transp=0, offset=-3, join=false)
Great Stuff.
Reply
synapticEx karabogerald
thanks
Reply
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体中文
繁體中文
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