Ascending and Descending sequence

Forums ProRealTime English forum ProBuilder support Ascending and Descending sequence

Viewing 3 posts - 1 through 3 (of 3 total)
  • #230722

    Hello, I need help with writing code for Ascending and Descending sequence .

    Ascending sequence start when close cross up yesterday’s high, with a green arrow and with the word “buy”. The dashed line will be drawn below the candle’s low as long as the close does not cross below yesterday’s low.

    Descending sequence start when close cross below yesterday’s low with a red arrow and with the word “sell”. The dashed line will be drawn above the candle’s high as long as the close does not cross up yesterday’s high.

    I would appreciate your help,

    Thanks in advance.

    #230730
    JS

    Hi,

    Try this one…

    1 user thanked author for this post.
    #230767

    Hi, thank you very much, i have made some changes, here is the code with changes.

    Dist=Average[5](Range)/10

    If xBuy=0 and xBuy[1]=0 and Close Crosses Over High[1] then
    DrawArrowUp(BarIndex,Low-3*Dist)Coloured(“Lime”)
    DrawText(“Buy”,BarIndex,Low-9*Dist,SansSerif,Bold,16)Coloured(“Lime”)
    xBuy=1
    xSell=0
    EndIf

    If xSell=0 and Close Crosses Under Low[1] then
    DrawArrowDown(BarIndex,High+3*Dist)Coloured(“Red”)
    DrawText(“Sell”,BarIndex,High+9*Dist,SansSerif,Bold,16)Coloured(“Red”)
    xBuy=0
    xSell=1
    EndIf

    If xBuy=1 and xSell[1]=1 then
    xBuy=1
    ElsIf xBuy=1 and xBuy[1]=1 then
    DrawSegment(BarIndex,Low,BarIndex-1,Low[1])Style(DottedLine,2)COLOURED(“Blue”)
    EndIf

    If xSell=1 and xBuy[1]=1 then
    xSell=1
    ElsIf xSell=1 and xSell[1]=1 then
    DrawSegment(BarIndex,High,BarIndex-1,High[1])Style(DottedLine,2)Coloured(“Red”)
    EndIf

    RETURN

    1 user thanked author for this post.
    avatar JS
Viewing 3 posts - 1 through 3 (of 3 total)

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