Tenkan-Sen Strenght – Ichomoku Strategy
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Tenkan-Sen Strenght – Ichomoku Strategy
- This topic has 3 replies, 2 voices, and was last updated 2 years ago by fab.ub.
-
-
09/11/2022 at 10:18 AM #200535
Good Morning All,
I have been studying Ichimoku strategy for a while. I’m trying to use the distance between Tenkan-Sen and price. I found this open code on Trading View and I was wonderign if someone can help me to transalte it for Pro Real Time.
Here the code:
//@version=4
study(title=”Tenkan-Sen Kijun-Sen Distance (TKD) Oscillator – Ichimoku”, shorttitle=”TKD”, overlay=false)conversionPeriods = input(9, minval=1, title=”Tenkan-Sen”)
basePeriods = input(26, minval=1, title=”Kijun-Sen”)
flip = input(false, title=”Flip Colors”)
color_bars = input(true, title=”Color Bars”)
donchian(len) => avg(lowest(len), highest(len))tenkan = donchian(conversionPeriods)
kijun = donchian(basePeriods)tk_diff = tenkan > kijun ? tenkan – kijun : kijun > tenkan ? kijun – tenkan : 0
diff_perc = (tk_diff / close) * 100last_signal = barssince(tenkan < kijun) < barssince(tenkan > kijun) ? -1 : 1
signal = tenkan > kijun or (tenkan == kijun and last_signal == -1) ? 1 : kijun > tenkan or (tenkan == kijun and last_signal == 1) ? -1 : 0colour1 = signal == 1 ? color.lime : signal == -1 ? color.red : color.blue
colour2 = signal == 1 ? color.red : signal == -1 ? color.lime : color.blue
colour = flip ? colour2 : colour1bar_color = color_bars ? colour : na
plot(diff_perc, linewidth=2, color=colour)
barcolor(bar_color)Thanks a lot
Fabio
09/16/2022 at 9:10 PM #20091509/17/2022 at 10:23 AM #200928If you need to know about BBCodes, you can find info at https://it.wikipedia.org/wiki/BBCode#Comandi_BBCode
09/17/2022 at 2:21 PM #200940 -
AuthorPosts