Tenkan-Sen Strenght – Ichomoku Strategy

Forums ProRealTime forum Italiano Supporto ProBuilder Tenkan-Sen Strenght – Ichomoku Strategy

Viewing 4 posts - 1 through 4 (of 4 total)
  • #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) * 100

    last_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 : 0

    colour1 = signal == 1 ? color.lime : signal == -1 ? color.red : color.blue
    colour2 = signal == 1 ? color.red : signal == -1 ? color.lime : color.blue
    colour = flip ? colour2 : colour1

    bar_color = color_bars ? colour : na

    plot(diff_perc, linewidth=2, color=colour)
    barcolor(bar_color)

    Thanks a lot

     

    Fabio

    #200915

    BBCodes ?

    #200928

    If you need to know about BBCodes, you can find info at https://it.wikipedia.org/wiki/BBCode#Comandi_BBCode

     

    #200940

    Grazie Roberto

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login