170 3 16
EXPERIMENTAL: test study on trend flow dinamics.
Remove from Favorite Scripts Add to Favorite Scripts
//  ||-----------------------------------------------------------------------------------------------------||
study("[RS]GB", overlay=true)
//  ||-----------------------------------------------------------------------------------------------------||
//  ||---   Step 1 : Section Size.  -----------------------------------------------------------------------||
sectionsize = (syminfo.mintick*10) * input(100)
sectionfraction = sectionsize * 0.01
//  ||-----------------------------------------------------------------------------------------------------||
//  ||---   Step 2 : Trend  -------------------------------------------------------------------------------||
trend = ema(ema(ohlc4, input(120)), input(24))
rangedetection = input(24)
trenddirection = rising(trend, rangedetection) and rising(trend, 1) ? 1 :
        falling(trend, rangedetection) and falling(trend, 1) ? -1 : 0
//  ||---    1 = UP TREND
//  ||---   -1 = DOWN TREND
//  ||---    0 = RANGE ::: need better way to define it!!
//  ||---
testc = trenddirection == 1 ? green : trenddirection == -1 ? maroon : gray
plot(trend, color=testc, linewidth=3)
plot(trend+sectionsize, color=green)
plot(trend+sectionsize*2, color=green)
plot(trend+sectionsize*3, color=green)
plot(trend+sectionsize*4, color=green)
plot(trend+sectionsize*5, color=green)
plot(trend-sectionsize, color=maroon)
plot(trend-sectionsize*2, color=maroon)
plot(trend-sectionsize*3, color=maroon)
plot(trend-sectionsize*4, color=maroon)
plot(trend-sectionsize*5, color=maroon)
//  ||---
//  ||-----------------------------------------------------------------------------------------------------||
//  ||---   Step 3 : Average Trend Angle  -----------------------------------------------------------------||
countertrend = trend - change(trend, input(120))
plot(countertrend, color=black, linewidth=3)
plot(countertrend+sectionsize, color=lime)
plot(countertrend+sectionsize*2, color=lime)
plot(countertrend+sectionsize*3, color=lime)
plot(countertrend+sectionsize*4, color=lime)
plot(countertrend+sectionsize*5, color=lime)
plot(countertrend-sectionsize, color=red)
plot(countertrend-sectionsize*2, color=red)
plot(countertrend-sectionsize*3, color=red)
plot(countertrend-sectionsize*4, color=red)
plot(countertrend-sectionsize*5, color=red)
//  ||-----------------------------------------------------------------------------------------------------||
//  ||-----------------------------------------------------------------------------------------------------||
//  ||-----------------------------------------------------------------------------------------------------||
DavidTrades
2 years ago
How does it work? Can you explain what is based on? It is very interesting.

Thanks
Reply
RicardoSantos PRO DavidTrades
2 years ago
its calculating a counter trend line from the inverse change ma, was just for studying purposes and i didnt went much further with it... thus the 'EXPERIMENTAL' note :p
Reply
DavidTrades RicardoSantos
2 years ago
I halved all of the parameters that were in default, works very well and adds a lot of information to the price action.
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