Tenkan-Sen Strenght – Ichomoku Strategy

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #200535 quote
    fab.ub
    Participant
    New

    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 quote
    fab.ub
    Participant
    New

    BBCodes ?

    #200928 quote
    robertogozzi
    Moderator
    Legend

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

    #200940 quote
    fab.ub
    Participant
    New

    Grazie Roberto

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Tenkan-Sen Strenght – Ichomoku Strategy


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by fab.ub
3 years, 12 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 09/11/2022
Status: Active
Attachments: No files
Logo Logo
Loading...