Ascending and Descending sequence
Forums › ProRealTime English forum › ProBuilder support › Ascending and Descending sequence
- This topic has 2 replies, 2 voices, and was last updated 8 months ago by ZAZI.
-
-
03/29/2024 at 7:49 PM #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.
03/30/2024 at 12:18 AM #230730Hi,
Try this one…
Ascending Descending Sequence1234567891011121314151617181920212223242526272829Dist=Average[5](Range)/10If xBuy=0 and xBuy[1]=0 and Close Crosses Over High[1] thenDrawArrowUp(BarIndex,High+Dist)Coloured("Lime")DrawText("Buy",BarIndex,High+2*Dist,SansSerif,Bold,16)Coloured("Lime")xBuy=1xSell=0EndIfIf xSell=0 and Close Crosses Under Low[1] thenDrawArrowDown(BarIndex,Low-Dist)Coloured("Red")DrawText("Sell",BarIndex,Low-2*Dist,SansSerif,Bold,16)Coloured("Red")xBuy=0xSell=1EndIfIf xBuy=1 and xSell[1]=1 thenxBuy=1ElsIf xBuy=1 and xBuy[1]=1 thenDrawSegment(BarIndex,Low,BarIndex-1,Low[1])Style(DottedLine,5)Coloured("Lime")EndIfIf xSell=1 and xBuy[1]=1 thenxSell=1ElsIf xSell=1 and xSell[1]=1 thenDrawSegment(BarIndex,High,BarIndex-1,High[1])Style(DottedLine,5)Coloured("Red")EndIfReturn1 user thanked author for this post.
03/30/2024 at 7:41 PM #230767Hi, 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
EndIfIf 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
EndIfIf 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”)
EndIfIf 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”)
EndIfRETURN
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on