Hello,
I tried to use the If....else...statement to for the DD variable in the below code to change of current price to either red or green depends on its current value to yesterday closing price. However, it have no luck so far. The below is a piece of code that I tried to work on.
Will you please take a look at it and provide me some guidance or hints to accomplish what I want to do?
Thanks in advance.
BK
//===============AFL Code==================
_SECTION_BEGIN("Magnified Market Price");
x=Status("pxchartright");
y=Status("pxcharttop");
x1=Status("pxcharleft");
FS=Param("Font Size",35,11,100,1);
GfxSelectFont("Times New Roman", 34, 700, italic = True, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorCustom9) );
Hor=Param("Horizontal Position",234,1,1200,1);
Ver=Param("Vertical Position",1,1,1,1);
GfxTextOut(""+C,x-110 , y-15 );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 14, 700, italic =True, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorCustom9) );
GfxTextOut(""+DD+" ("+xx+"%)", x-110, y+40 );
GfxSelectFont("arial", 18 );
_SECTION_END();
//===============End Code==================
I tried to use the If....else...statement to for the DD variable in the below code to change of current price to either red or green depends on its current value to yesterday closing price. However, it have no luck so far. The below is a piece of code that I tried to work on.
Will you please take a look at it and provide me some guidance or hints to accomplish what I want to do?
Thanks in advance.
BK
//===============AFL Code==================
_SECTION_BEGIN("Magnified Market Price");
x=Status("pxchartright");
y=Status("pxcharttop");
x1=Status("pxcharleft");
FS=Param("Font Size",35,11,100,1);
GfxSelectFont("Times New Roman", 34, 700, italic = True, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorCustom9) );
Hor=Param("Horizontal Position",234,1,1200,1);
Ver=Param("Vertical Position",1,1,1,1);
GfxTextOut(""+C,x-110 , y-15 );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 14, 700, italic =True, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorCustom9) );
GfxTextOut(""+DD+" ("+xx+"%)", x-110, y+40 );
GfxSelectFont("arial", 18 );
_SECTION_END();
//===============End Code==================