Is there any way to create a dynamic color where the False of the IIF statement is something like 'null', 'clear', or 'transparent'?
Thanks.
Matt
Is there any way to create a dynamic color where the False of the IIF statement is something like 'null', 'clear', or 'transparent'?
Thanks.
Matt
There is no transparent color but you can plot only some of the bars if you pass NULL in actual array to be plotted:
// Null does not plot anything
Plot( IIF( C > MA( C, 10 ), Close, Null ), "Price", colorDefault );
Tomasz,
Thanks for replying. Before I wrote my post, I tried that. Here is the background and my result:
dynacolor = IIf(idid,ParamColor("ID Color",colorOrange),Null);
PlotOHLC(O,H,L,C,"OHLC",dynacolor,style=styleBar,0,0,0,level,thickness);
The result when I plot this is that bars that are not Inside Days change to Gray. They are no longer Black. It had the appearance that Null averaged Black with "nothing" and essentially halved the Black intensity, making it Gray.
But, there may be another reason for the color becoming gray. Am I doing something wrong?
Thanks.
Matt
Tomasz,
Oh, I misunderstood you! Yes, I see now that I pass the Null to the conditions describing when I want it painted and I then pass that to the Plot function. Brilliant. I see it now. I apologize for my prior post, as I was responding to what I THOUGHT you said and not what you actually said.
I will try to read more carefully in the future.
Thanks.
Matt
As I wrote, use Null in DATA array, not color array. Color must not be null.
You should be using:
color = ParamColor("ID Color",colorOrange);
Plot( IIF( idid, C, Null ),"OHLC",color ,styleBar,0,0,0,level,thickness);
I am using Plot() because OHLC prices are used implictly when you draw bars or candles.
Tomasz,
Our posts crossed in Cyberspace. I tried to post mine before you had to respond once again to me. Again, I apologize.
Matt
I just want to confirm to everyone, Tomasz' solution worked perfectly! Thanks again, Tomasz for the kind help!
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.