Need help to change the color of this afl

#1
This is the AFL
Variable = WriteIf(C<p,"Up",WriteIf(C>p,"Down","Neutral"));
GfxSetTextColor(colorTurquoise);
GfxTextOut("TPre = "+ Variable,550,60);

I need help to change the color of the "GfxSetTextColor",when its "Up" the color is "Green", when its "Down" the color is "Red* and "neutral" the color is"Yellow".
 
#2
This is the AFL
Variable = WriteIf(C<p,"Up",WriteIf(C>p,"Down","Neutral"));
GfxSetTextColor(colorTurquoise);
GfxTextOut("TPre = "+ Variable,550,60);

I need help to change the color of the "GfxSetTextColor",when its "Up" the color is "Green", when its "Down" the color is "Red* and "neutral" the color is"Yellow".
No this is not an AFL. This is only part
Post the whole AFL and maybe we can help
If you are trying to hide something then nobody cab help
What is the variable and what is p
 

HULK

Active Member
#3
Dear Gero

Insted of useing GfxSetTextColo & TextOut use
following code in ur afl

Plot(IIf(p> C,p,Null),"UP",ParamColor("TPre ="+Variable,550,60,colorGreen)));
Plot(IIf(p < C,p,Null),"Down",ParamColor("TPre ="+Variable,550,60,colorRed)));

This is what maximum I can help u right now

Since I dont have ur AFL full code

HULK
 
#4
Dear HULK

I'm a newbie and try to make a part of AFL to add on every AFL we had, this is the complete,
p = ( H+ L + C )/3;
Variable = WriteIf(C<p,"Up",WriteIf(C>p,"Down","Neutral"));
GfxSetTextColor(colorTurquoise);
GfxTextOut("TPre = "+ Variable,550,60);

Thank's for your help
 
#6
Experts please help.
I'm a newbie and try to make a part of AFL to add on every AFL we had, this is the complete,
p = ( H+ L + C )/3;
Variable = WriteIf(C<p,"Up",WriteIf(C>p,"Down","Neutral"));
GfxSetTextColor(colorTurquoise);
GfxTextOut("TPre = "+ Variable,550,60);

Thank's for your help
 

casoni

Well-Known Member
#7
Is it possible to add conditional color? Experts please help.....
Hello Mental ,
Check this
is this what you want ? [ i havent tested , but i think this will help ].

p = ( H+ L + C )/3;
Variable = WriteIf(C<p,"Down",WriteIf(C>p,"Up","Neutral"));
Rise=SelectedValue(C>p);
Fall=SelectedValue(C<p);
//neutral=SelectedValue(C==p);
radius = 0.01 * Status("pxheight");
textoffset = 1 * radius;
GfxSelectFont("Tahoma", 12 , 500);
GfxSetOverlayMode(0);
Color=IIf(rise,colorGreen,IIf(Fall,colorRed,colorTan));
GfxSetTextColor(color);
GfxTextOut("Tre :"+ Variable , textoffset , Status("pxheight")-30 );
Thank you
 
#8
p = ( H+ L + C )/3;
Variable = WriteIf(C<p,"Down",WriteIf(C>p,"Up","Neutral"));
Rise=SelectedValue(C>p);
Fall=SelectedValue(C<p);
//neutral=SelectedValue(C==p);
radius = 0.01 * Status("pxheight");
textoffset = 1 * radius;
GfxSelectFont("Tahoma", 12 , 500);
GfxSetOverlayMode(0);
Color=IIf(rise,colorGreen,IIf(Fall,colorRed,colorTan));
GfxSetTextColor(color);
GfxTextOut("Tre :"+ Variable , textoffset , Status("pxheight")-30 );
Your code is very useful to me for changing color in one AFL. thanks for your code.
 

Similar threads