Converting indicator STC

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #197356 quote
    mariamfimariamfi
    Participant
    New

    The following is a code for STC indicator from trading view

    I need to use it in prorealtime

     

    //@version=5
    //[SHK] STC colored indicator
    //https://www.tradingview.com/u/shayankm/

    indicator(title='[SHK] Schaff Trend Cycle (STC)’, shorttitle=’STC’, overlay=false)
    EEEEEE = input(12, ‘Length’)
    BBBB = input(26, ‘FastLength’)
    BBBBB = input(50, ‘SlowLength’)

    AAAA(BBB, BBBB, BBBBB) =>
    fastMA = ta.ema(BBB, BBBB)
    slowMA = ta.ema(BBB, BBBBB)
    AAAA = fastMA – slowMA
    AAAA

    AAAAA(EEEEEE, BBBB, BBBBB) =>
    AAA = input(0.5)
    var CCCCC = 0.0
    var DDD = 0.0
    var DDDDDD = 0.0
    var EEEEE = 0.0
    BBBBBB = AAAA(close, BBBB, BBBBB)
    CCC = ta.lowest(BBBBBB, EEEEEE)
    CCCC = ta.highest(BBBBBB, EEEEEE) – CCC
    CCCCC := CCCC > 0 ? (BBBBBB – CCC) / CCCC * 100 : nz(CCCCC[1])
    DDD := na(DDD[1]) ? CCCCC : DDD[1] + AAA * (CCCCC – DDD[1])
    DDDD = ta.lowest(DDD, EEEEEE)
    DDDDD = ta.highest(DDD, EEEEEE) – DDDD
    DDDDDD := DDDDD > 0 ? (DDD – DDDD) / DDDDD * 100 : nz(DDDDDD[1])
    EEEEE := na(EEEEE[1]) ? DDDDDD : EEEEE[1] + AAA * (DDDDDD – EEEEE[1])
    EEEEE

    mAAAAA = AAAAA(EEEEEE, BBBB, BBBBB)
    mColor = mAAAAA > mAAAAA[1] ? color.new(color.green, 20) : color.new(color.red, 20)

     

    if mAAAAA[3] <= mAAAAA[2] and mAAAAA[2] > mAAAAA[1] and mAAAAA > 75
    alert(“Red”, alert.freq_once_per_bar)
    if mAAAAA[3] >= mAAAAA[2] and mAAAAA[2] < mAAAAA[1] and mAAAAA < 25
    alert(“Green”, alert.freq_once_per_bar)

    plot(mAAAAA, color=mColor, title=’STC’, linewidth=2)

    ul = plot(25, color=color.new(color.gray, 70))
    ll = plot(75, color=color.new(color.gray, 70))
    fill(ul, ll, color=color.new(color.gray, 96))

    #197361 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can search the forum to find what is of your interest.

    There you go https://www.prorealcode.com/prorealtime-indicators/schaff-trend-cycle/

Viewing 2 posts - 1 through 2 (of 2 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

Converting indicator STC


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
mariamfi @mariamfi Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/16/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...