Is there any way to code and find out the timestamp?
Forums › ProRealTime English forum › ProScreener support › Is there any way to code and find out the timestamp?
- This topic has 7 replies, 3 voices, and was last updated 2 years ago by Suzu Yuk.
Tagged: highestbars
-
-
02/24/2022 at 4:35 PM #188776Hello,Does anyone know how to scan the highest high and lowest low cycle frequency is getting shorter or longer? Please see attached picture.I would like to find a timestamp (say X1, X2, X3,,,,,) for each highest high and lowest low. Then (X2 – X1) can tell us how long it took to make each price cycle. By comparing (X2 – X1) and (X3 – X2), I can say whether the price cycle is getting longer or shorter.Regards,02/24/2022 at 6:07 PM #188785
Try this (not tested):
12345678910111213141516171819202122232425262728293031p = 40x3 = highest[p](high)x2 = highest[p](high[p])x1 = highest[p](high[p * 2])For i = (p*3)-1 downto (p*2)if high[i] = x1 thenb1 = BarIndex[i]BreakEndifNextFor i = (p*2)-1 downto pif high[i] = x2 thenb2 = BarIndex[i]BreakEndifNextFor i = p-1 downto 0if high[i] = x3 thenb3 = BarIndex[i]BreakEndifNextx1x2 = b2 - b1x2x3 = b3 - b2x = 0If x1x2 > x2x3 thenx = 1Elsif x1x2 < x2x3 thenx = 2EndifScreener[x](x as “1=x1x2, 2=x2x3")02/24/2022 at 6:21 PM #188789The new instruction HighestBars could help in this case.
02/24/2022 at 11:58 PM #188803This is the code with the new instruction suggested by Nicolas:
12345678910111213p = 40b3 = highestbars[p](high)b2 = highestbars[p](high[p])b1 = highestbars[p](high[p * 2])x1x2 = b2 - b1x2x3 = b3 - b2x = 0If x1x2 > x2x3 thenx = 1Elsif x1x2 < x2x3 thenx = 2EndifScreener[x](x as “1=x1x2, 2=x2x3")03/01/2022 at 7:37 PM #189153Thank you very much for your swift reply. I have been tucking to understand the following part of the previously mentioned solution by dissecting the last few days. However, I am still stuck with understanding the below:
highestbars1b3 = highestbars[p](high) b2 = highestbars[p](high[p])I understand “b3 = highestbars[p](high),” but I am not sure if I understand “b2 = highestbars[p](high[p]).” Why :[p](high[p]?” Why “p” in those two places?
In order to dissect and understand them on cash 500, ticker “SPTRD,” I program them to print out the code with two variable periods “p1” and “p2.”
printout version1234567891011121314151617p1=4p2=4b3 = highestbars[p1](high)DRAWTEXT("#b3#", barindex, high+range*2, Dialog, Standard, 10) COLOURED(255,0,0)b2 = highestbars[p1](high[p2])//DRAWTEXT("#Hp2#", barindex, high+range*0.6, Dialog, Standard, 12)DRAWTEXT("#b2#", barindex, high+range*1.4, Dialog, Standard, 12)COLOURED(0,0,0)b1 = highestbars[p1](high[p2 * 2])//x1x2 = b2 - b1//x2x3 = b3 - b2//x = 0//If x1x2 > x2x3 then//x = 1//Elsif x1x2 < x2x3 then//x = 2//EndifreturnIf anyone can possibly rephrase them in words, I would highly appreciate it very much.
03/01/2022 at 9:31 PM #189164This line will check a highest value among the latest p bars (from 0 to 39):
1highestbars[p](high)you need two prior additional ones to find all the three, one between bars 40-79 and the leftmost one between bars 80-119.
You can evaluate the expressions within brackets to check that.
03/03/2022 at 9:19 AM #189225Thank you very much for your reply. In order to understand what is going on with the code, I quantified the changing output with the gradation of color on cash 500, ticker symbol “SPTRD, screenshot attached. Would anyone agree with me the below:
The blue gradation seems to illustrate the price cycle to be getting shorter.
The black gradation seems to illustrate the price cycle to be getting longer.
I am not sure yet if I can conclude as the above. I appreciate it very much if I can hear how other people can observe this outcome? Thank you
p=4
b3 = highestbars[p1](high)
//DRAWTEXT(“#b3#”, barindex, high+range*2, Dialog, Standard, 10) COLOURED(255,0,0)
Hp2=high[p2]
b2 = highestbars[p1](high[p1])
//DRAWTEXT(“#Hp2#”, barindex, high+range*0.6, Dialog, Standard, 12)
//DRAWTEXT(“#b2#”, barindex, high+range*1.4, Dialog, Standard, 12)COLOURED(0,0,0)
b1 = highestbars[p1](high[p1 * 2])
//DRAWTEXT(“#b1#”, barindex, high+range*0.7, Dialog, Standard, 12)COLOURED(0,0,255)
x1x2 = b2 – b1
x2x3 = b3 – b2
x = 0
If x1x2 > x2x3 then
M1 = x1x2 – x2x3
HiM1=highest[pM1](M1)
DRAWTEXT(“▇”, barindex, 1.001*highest[Hip](high), Dialog, Standard, 12)COLOURED(0,0,255, 255*M1/HiM1)
x = 1
Elsif x1x2 < x2x3 then
M2 = -x1x2 + x2x3
HiM2=highest[pM1](M2)
DRAWTEXT(“▇”, barindex, 1.002*highest[Hip](high), Dialog, Standard, 12)COLOURED(0,0,0, 255*M2/HiM2)
x = 2
Endif
return03/03/2022 at 10:46 AM #189229color gradation on cash 500 1 hour 50000units, ticker “SPTRD123456789101112131415161718192021222324252627p1=170p2=170pM1=170Hip=211b3 = highestbars[p1](high)//DRAWTEXT("#b3#", barindex, high+range*2, Dialog, Standard, 10) COLOURED(255,0,0)Hp2=high[p2]b2 = highestbars[p1](high[p1])//DRAWTEXT("#Hp2#", barindex, high+range*0.6, Dialog, Standard, 12)//DRAWTEXT("#b2#", barindex, high+range*1.4, Dialog, Standard, 12)COLOURED(0,0,0)b1 = highestbars[p1](high[p1 * 2])//DRAWTEXT("#b1#", barindex, high+range*0.7, Dialog, Standard, 12)COLOURED(0,0,255)x1x2 = b2 - b1x2x3 = b3 - b2x = 0If x1x2 > x2x3 thenM1 = x1x2 - x2x3HiM1=highest[pM1](M1)DRAWTEXT("▇", barindex, 1.001*highest[Hip](high), Dialog, Standard, 12)COLOURED(0,0,255, 255*M1/HiM1)x = 1Elsif x1x2 < x2x3 thenM2 = -x1x2 + x2x3HiM2=highest[pM1](M2)DRAWTEXT("▇", barindex, 1.002*highest[Hip](high), Dialog, Standard, 12)COLOURED(0,0,0, 255*M2/HiM2)x = 2Endifreturn1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on