UT Bot Alerts

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

    Hi, does any body know if this Trading View indicator has been coded for PRT?

    #218571 quote
    Nicolas
    Keymaster
    Master

    Yes, this code gives the signals of a SuperTrend calculated with the Close of a Heikin Ashi candle (TOTALPRICE), i.e. :

    a = 1 //Key Vaule. ‘This changes the sensitivity'
    c = 10 //ATR Period
    
    multiplier=a
    period=10
    
    moy=averagetruerange[period](close)
    iprice=totalprice
    up=iprice+multiplier*moy
    dn=iprice-multiplier*moy
    once trend=1
    if close>up[1] then
    trend=1
    elsif close<dn[1] then
    trend=-1
    endif
    if trend<0 and trend[1]>0 then
    flag=1
    else
    flag=0
    endif
    if trend>0 and trend[1]<0 then
    flagh=1
    else
    flagh=0
    endif
    if trend>0 and dn<dn[1] then
    dn=dn[1]
    endif
    if trend<0 and up>up[1] then
    up=up[1]
    endif
    if flag=1 then
    up=iprice+multiplier*moy
    endif
    if flagh=1 then
    dn=iprice-multiplier*moy
    endif
    if trend=1 then
    mysupertrend=dn
    else
    mysupertrend=up
    endif
    if mysupertrend > mysupertrend[1] then
    color1=0
    color2=255
    color3=0
    elsif mysupertrend < mysupertrend[1] then
    color1=255
    color2=0
    color3=0
    endif
    
    if iprice crosses over mysupertrend then 
    drawarrowup(barindex,mysupertrend) coloured("green")
    endif 
    if iprice crosses under mysupertrend then 
    drawarrowdown(barindex,mysupertrend) coloured("red")
    endif 
    
    return mysupertrend coloured (color1,color2,color3) as "SuperTrend"
    ut-bot-alerts-indicator.png ut-bot-alerts-indicator.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

UT Bot Alerts


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Berwick @berwick Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/02/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...