ALERT: Revert Signal ver 2

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #129818 quote
    segiesegie
    Participant
    Senior

    Hi,

    Can an alert indicator be created for this coding?

    Regards,

    Segie

    //PRC_RevertSignal Three Line Break | indicator
    //22.06.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from Nanotrader
    
    if barindex=1 then //barindex
    if (close >= open) then
    xtrend = 1
    trend = xtrend
    xu = low//close
    xu1 = open
    xu2 = open
    xu3 = open
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    else
    xtrend = -1
    trend = xtrend
    xu = high//close
    xu1 = open
    xu2 = open
    xu3 = open
    CL = xu
    OP = xu1
    LL = CL
    HH = OP
    endif
    else //barindex continue
    if (xtrend = 1) then
    if (high > xu) then
    trend = xtrend
    xu3 = xu2
    xu2 = xu1
    xu1 = xu
    xu = high//close
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    elsif (low < xu3) then
    xtrend = -1
    trend = xtrend
    xu = low//close
    xu2 = xu1
    xu3 = xu1
    CL = xu
    OP = xu1
    LL = CL
    HH = OP
    else
    trend = xtrend
    CL = CL[1]
    OP = OP[1]
    LL = LL[1]
    HH = HH[1]
    endif
    else //xtrend <>1
    if (high > xu3) then
    xtrend = 1
    trend = xtrend
    xu = high//close
    xu2 = xu1
    xu3 = xu1
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    elsif (low < xu) then
    trend = xtrend
    xu3 = xu2
    xu2 = xu1
    xu1 = xu
    xu = low//close
    CL = xu
    OP = xu1
    LL = CL
    HH = OP
    else
    trend = xtrend
    CL = CL[1]
    OP = OP[1]
    LL = LL[1]
    HH = HH[1]
    endif
    endif
    endif
    
    if trend>0 then
    r=0
    g=200
    b=0
    else
    r=200
    g=0
    b=0
    endif
    
    if trend<>trend[1] then
    //BACKGROUNDCOLOR(200,200,200)
    endif
    
    RETURN CL coloured (r,g,b), xu3 coloured (r,g,b)
    #129878 quote
    NicolasNicolas
    Keymaster
    Legend

    Change the RETURN instruction with:

    RETURN CL coloured (r,g,b), xu3 coloured (r,g,b), trend<>trend[1]

     

    and with the alert tool, check if the last returned variable is equal to 1 or not, it would signal the change of trend according to this indicator.

    segie thanked this post
    #129900 quote
    segiesegie
    Participant
    Senior

    Got it done. Thanks!

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

ALERT: Revert Signal ver 2


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
segie @segie Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by segiesegie
6 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/04/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...