Modify PRC_swing teller live count2 indicator
Forums › ProRealTime English forum › ProBuilder support › Modify PRC_swing teller live count2 indicator
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by AVT.
-
-
12/21/2017 at 10:44 AM #56230
Hi,
Can anyone tell me how to modify the PRC_swing teller live count2 indicator in a way only the recent candle counting (from 1 to ….) is visible on the chart? This will give the charts a ‘cleaner’ view.
PRC_swing teller live count2 indicator123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100//PRC_swing teller live count2 | indicator//version with rounded numbers and below/above each candle//07.04.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//https://www.prorealcode.com/topic/rewrite-code-to-prorealtime-code/Lb=4//continue swing Upif UpCount>0 and Close>Close[Lb] thenDownCount=0UpCount=UpCount+1//draw countif UpCount=2 thendrawtext("2",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=3 thendrawtext("3",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=4 thendrawtext("4",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=5 thendrawtext("5",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=6 thendrawtext("6",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=7 thendrawtext("7",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=8 thendrawtext("8",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)elsif UpCount=9 thendrawtext("9",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)last9bar=barindex//reset countUpCount=0endif//up swing failelsif UpCount>0 and Close<Close[Lb] then//draw fail countdrawtext("F",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)//reset countUpCount=0endif//continue swing Downif DownCount>0 and Close<Close[Lb] thenUpCount=0DownCount=DownCount+1//draw countif DownCount=2 thendrawtext("2",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=3 thendrawtext("3",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=4 thendrawtext("4",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=5 thendrawtext("5",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=6 thendrawtext("6",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=7 thendrawtext("7",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=8 thendrawtext("8",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)elsif DownCount=9 thendrawtext("9",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)last9bar=barindex//reset countDownCount=0endif//down swing failelsif DownCount>0 and Close>Close[Lb] then//draw fail countdrawtext("F",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)//reset countDownCount=0endif//begin swing Upif UpCount=0 and barindex-last9bar>1 thenr = close[Lb]if close>r thenUpCount=1DownCount=0//draw countdrawtext("1",barindex,low-CountDistance*pointsize,Dialog,Standard,12) coloured(0,200,0)endifendif//begin swing Downif DownCount=0 and barindex-last9bar>1 thenr = close[Lb]if close<r thenDownCount=1UpCount=0//draw countdrawtext("1",barindex,high+CountDistance*pointsize,Dialog,Standard,12) coloured(200,0,0)endifendifreturn12/21/2017 at 2:15 PM #56248What about this:
https://www.prorealcode.com/documentation/calculateonlastbars/
12/21/2017 at 6:02 PM #56275@AVT Thanks a lot. Is it possible to code this code in multiple (10) bars? It does not seems to work.
My intention is that only the counted numbers on the last 10 candles are visible.
DefParam DrawOnLastBarOnly123DefParam[10}DefParam DrawOnLastBarOnly = true12/21/2017 at 7:54 PM #56284I gave you the link. This is describing exactely how you write the code (you can even simply copy and paste it).
Now for the explanation:
- DEFPARAM things always stand in the very beginning of the whole code page
- CalculateOnLastBars=x says, all what is calculated in the whole code page is only calculated with (the data of) the said x bars in our chart, be that a line or a range or whatever – means also be careful not make it too small (for example: you can not calculate an ema(200) if you limit calculation to 100 bars).
So the code looks like this:
limit swing teller number generating123//https://www.prorealcode.com/topic/rewrite-code-to-prorealtime-code/DEFPARAM CalculateOnLastBars = 10 // <=== added at the very beginningLb=4Attached the result. Hope this is what you had in mind.
2 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on