# [RS]GB

193 3
EXPERIMENTAL: test study on trend flow dinamics.
```//  ||-----------------------------------------------------------------------------------------------------||
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)
//  ||-----------------------------------------------------------------------------------------------------||
//  ||-----------------------------------------------------------------------------------------------------||
//  ||-----------------------------------------------------------------------------------------------------||
```
How does it work? Can you explain what is based on? It is very interesting.

Thanks
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
RicardoSantos
I halved all of the parameters that were in default, works very well and adds a lot of information to the price action.
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