Wicks
Forums › ProRealTime English forum › ProBuilder support › Wicks
- This topic has 11 replies, 5 voices, and was last updated 1 year ago by daxtrader3.
-
-
10/20/2020 at 9:10 AM #147852
Hi
How do I write the code if I want too identify wicks on previous Heiken-Ashi candle? I want too be able too identify if previous red Heiken has no wick on the upper side and if previous green Heiken has no wick on the lower side.
10/20/2020 at 9:33 AM #147855There you go (not tested):
1234567891011121314once xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))//xTypic = (xHigh + xLow + xClose) / 3//xMed = (xHigh + xLow) / 2//xRange = xHigh - xLowBullish = xClose > xOpenBearish = xClose < xOpenRed = Bearish AND (xOpen = xHigh)Green = Bullish AND (xOpen = xLow)RED is the current candle, RED[1] is the previous one, RED[2] is the second previous one, and so on….
The same is true for GRREN candles.
1 user thanked author for this post.
10/20/2020 at 9:36 AM #14785710/20/2020 at 9:37 AM #147858The way I did.
1 user thanked author for this post.
10/20/2020 at 9:40 AM #14786110/20/2020 at 9:57 AM #147868As I said, RED is the current candle, RED[1] is the previous one, RED[2] is the second previous one, and so on….
You need to watch some videos about programming at https://www.prorealcode.com/programming-with-prorealtime/, or at https://www.prorealtime.com/en/videos_tutorial-trading and on the ProRealTime’s YouTube channel.
Moreover, reading documentation at https://trading.prorealtime.com/en/programming-help and some of the thousands of code examples in this forum may further help.
We cannot take a complete course post after post!
1 user thanked author for this post.
10/20/2020 at 10:12 AM #14787110/20/2020 at 10:21 AM #147875You have everything in Roberto’s code.
Here a version that you can put under your chart with “barchart” for green and red parameters OR on your graphs with arrows for No-Wicks candles.
123456789101112131415161718192021222324once xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))//xTypic = (xHigh + xLow + xClose) / 3//xMed = (xHigh + xLow) / 2//xRange = xHigh - xLowBullish = xClose > xOpenBearish = xClose < xOpenRed = Bearish AND (xOpen = xHigh)Green = Bullish AND (xOpen = xLow)if Green thendrawarrowup(barindex,lowest[3](low)) coloured(0,255,51)endifif Red thendrawarrowdown(barindex,highest[3](high)) coloured(102,102,102)endifreturn red as "red" , green as "green"1 user thanked author for this post.
10/08/2023 at 9:09 AM #222153You have everything in Roberto’s code.
Here a version that you can put under your chart with “barchart” for green and red parameters OR on your graphs with arrows for No-Wicks candles.
123456789101112131415161718192021222324once xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))//xTypic = (xHigh + xLow + xClose) / 3//xMed = (xHigh + xLow) / 2//xRange = xHigh – xLowBullish = xClose > xOpenBearish = xClose < xOpenRed = Bearish AND (xOpen = xHigh)Green = Bullish AND (xOpen = xLow)if Green thendrawarrowup(barindex,lowest[3](low)) coloured(0,255,51)endifif Red thendrawarrowdown(barindex,highest[3](high)) coloured(102,102,102)endifreturn red as “red” , green as “green”Hi Roberto, Luciole – I have tried to programme on arrow, alert when RED crosses over Green and vice versa i.e. when open trying to go over last bar with no wicks and vice versa for down, but not working as I might need to loop, also to calculate points /pips from last arrow/alert on either side, which I am not able to do, please can you help?
//minCandles = 1
//
once xOpen = open
xClose = (open + close + high + low) / 4
if barindex > 0 then
xOpen = (xOpen + xClose[1]) / 2
trigger=xOpen
endif
xLow = min(low,min(xClose,xOpen))
xHigh = max(high,max(xClose,xOpen))
xpip=xHigh-xLow
//xTypic = (xHigh + xLow + xClose) / 3
//xMed = (xHigh + xLow) / 2
//xRange = xHigh – xLow
Bullish = xClose > xOpen
Bearish = xClose < xOpen
Red = Bearish AND (xOpen = xHigh)
Green = Bullish AND (xOpen = xLow)
c1=Bullish crosses over Red
c2=Green crosses under Redif c1 and trigger then
drawarrowup(barindex,lowest[3](low)) coloured(0,255,51)
//DRAWTEXT(xpip,barindex,highest[8],Dialog,Bold,5) coloured(“Green”)
endifif c2 and trigger then
drawarrowdown(barindex,highest[3](high)) coloured(102,102,102)
endifreturn c1 or c2
10/08/2023 at 9:26 AM #222156I think I sorted the 1st issue with crosses under and over. Now I am getting the right alert.
Still need help with calculating number of points from last top or bottom to current price, it’s difficult to get around on my own, please help?
10/08/2023 at 10:57 AM #222158never mind, all sorted now,, thanks!
1 user thanked author for this post.
11/07/2023 at 11:40 PM #223329@amitoverseas40, how did you to have the arrows on the right place? Thanks in advance
-
AuthorPosts