R,G,B colours are mixed?
Forums › ProRealTime English forum › ProBuilder support › R,G,B colours are mixed?
- This topic has 19 replies, 3 voices, and was last updated 5 years ago by robert123.
-
-
08/24/2019 at 2:58 PM #105439
Hi there,
Could anyone help me with the below question, please?
I am colour coding using R,G, B. This work brilliantly when used in a moving average (as you can see the subtle, changes via the colour changes) but when I transfer the same idea to text it freaks out when these colour changes occur, i.e does recognise x as a spectrum of say blue.
Has anyone encountered this before?. Is this just something that happens with text?
TIA
RR
08/24/2019 at 4:18 PM #105446I never had a chance to spot that issue.
Can you post an example?
08/24/2019 at 4:35 PM #105448Hi Roberto,
Thank you for your swift reply.
Below is a snippet of the relevant part of the code. When I change the function to return the ‘returned’ value to text I get an error message the colour x is out of x colours range.
Hope that makes sense, and thank you for your help.
12345678910111213141516171819202122diff=exponentialaverage[36](srtl)-srtlif diff>0 thenhi=highest[20](diff)elsif diff<0 thenlo=lowest[20](diff)endifhig=highest[20](hi)loo=lowest[20](lo)if srtl>srtr and diff<0 thenr=250g=0b=250elsif srtl<srtr and diff>0 thenr=0g=255b=0elsif srtl<srtr and diff<0 thenr=255g=0b=0endifreturn diff coloured(r,g,b),hig,loo,ExponentialAverage[36](diff)08/24/2019 at 4:52 PM #105450> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
What are SRTL and SRTR, I get an error messages since they are not defined?
08/24/2019 at 5:01 PM #105451SRY!
Difficult to explain srtl and srtr without putting the whole code in, which is long.. but the problem should show it’s self if you were to use a standard ma or two. It just seems strange that the colouring works in the ‘return’ format but not the text.
Thanks for your help
RR
08/24/2019 at 5:29 PM #105452This is the code:
12345678910111213141516171819202122232425srtl=close //just to let it have a valuesrtr=high //just to let it have a valuediff=exponentialaverage[36](srtl)-srtlif diff>0 thenhi=highest[20](diff)elsif diff<0 thenlo=lowest[20](diff)endifhig=highest[20](hi)loo=lowest[20](lo)if srtl>srtr and diff<0 thenr=250g=0b=250elsif srtl<srtr and diff>0 thenr=0g=255b=0elsif srtl<srtr and diff<0 thenr=255g=0b=0endifdrawtext("☺",BarIndex, hig+10*pipsize) coloured(r,g,b)return diff coloured(r,g,b),hig,loo,ExponentialAverage[36](diff)and the attached pic is the output.
What is exactly the issue?
08/24/2019 at 6:55 PM #105462Well, that is interesting!
Because this is what I get, see below. And it is these colours that a) seem to change from the red/green spectrum to what you see below. B) when the same code is applied to ‘text’ in the price panel it freaks out.
Do you think a negative number would cause this?
I like the colour change just not the text freak out!
RR
08/24/2019 at 7:12 PM #10546408/24/2019 at 7:49 PM #10546608/24/2019 at 9:47 PM #105475My previous two first lines yielded only 2 results, thus one colour was missing (your code has 3 combinations).
With the two averages, as you suggested, I notice 3 colours, the same for both returned data and text:
12345678910111213141516171819202122232425srtl=average[20,1](close)srtr=average[100,1](close)diff=exponentialaverage[36](srtl)-srtlif diff>0 thenhi=highest[20](diff)elsif diff<0 thenlo=lowest[20](diff)endifhig=highest[20](hi)loo=lowest[20](lo)if srtl>srtr and diff<0 thenr=250g=0b=250elsif srtl<srtr and diff>0 thenr=0g=255b=0elsif srtl<srtr and diff<0 thenr=255g=0b=0endifdrawtext("☺",BarIndex, hig+10*pipsize) coloured(r,g,b)return diff coloured(r,g,b),hig,loo,ExponentialAverage[36](diff)I still can’t see any issue.
08/27/2019 at 9:09 AM #10563308/27/2019 at 9:35 AM #105634Sorry, but it works everywhere for me, in some cases you may see a black line when the indicator overlaps one of the bands, but that’s normal.
I cannot be of further help. If the problem persists, you’d better press Ctrl+M from the platform to ask for assistance.
08/27/2019 at 3:00 PM #10565208/27/2019 at 3:17 PM #10565308/27/2019 at 3:19 PM #105655 -
AuthorPosts
Find exclusive trading pro-tools on