Help my MACD Condition AFL , please

#1
Dear All member Traderji

I have a problem with my afl
I have some condition about MACD Condition :

If condition : MACDHIghBullish ---> appears text : HIGH Bullish Condition [ Brightgreen , with position x+1325 , y+132 ]
If condition : MACDLowBullish ---> appears text : LOW Bullish Condition [ Green , with position x+1325 , y+132 ]

If condition : MACDLowBearish ---> appears text : LOW Bearish Condition [ Pink , with position x+1325 , y+132 ]
If condition : MACDHIghBearish ---> appears text : HIGH Bearish Condition [ Red, with position x+1325 , y+132 ]

I've tried but the textout that appears to overlap and I try
Writeif ( "-- HIGH Bullish Condition", x+1325, y+132) ; ---- > but Still error
Writeif ( "-- LOW Bullish Condition", x+1325, y+132) ; ---- > Still error

Hope dear all member can help me, please because it's important for my trading plan

Thank you before


AFL code :

//==========================================================================================================================
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("MACD Condition {{NAME}} - {{INTERVAL}} {{DATE}} Open %g High %g Low %g Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorSkyblue ));

MACDHIghBullish = (MACD(12,26) > Signal(12,26,9)) AND (MACD (12,26)) > 0 ;
MACDLowBullish = (MACD(12,26) > Signal(12,26,9)) AND (MACD (12,26)) < 0 ;

MACDLowBearish = (MACD(12,26) < Signal(12,26,9)) AND (MACD (12,26)) > 0 ;
MACDHIghBearish = (MACD(12,26) < Signal(12,26,9)) AND (MACD (12,26)) < 0 ;


x=Param("xposn",1,0,1000,1);
y=Param("yposn",1,0,1000,1);
GfxSetBkMode(1);

GfxSelectFont( "Calibri", 13, 800, False );
GfxSetTextColor( colorWhite );
GfxTextOut( "MACD Condition = ",x+1200, y+132);
GfxSetTextColor (IIf( SelectedValue(MACDHIghBullish) ,colorBrightGreen,colorWhite));
Writeif ( "-- HIGH Bullish Condition", x+1325, y+132); --> error

GfxSetTextColor (IIf( SelectedValue(MACDLowBullish) ,colorGreen,colorWhite));
Writeif( "-- LOW Bullish Condition", x+1325, y+132); --> error

GfxSetTextColor (IIf( SelectedValue(MACDLowBearish) ,colorPink,colorWhite));
Writeif( "-- LOW Bearish Condition", x+1325, y+132); ---> error

GfxSetTextColor (IIf( SelectedValue(MACDHIghBearish) ,colorRed,colorWhite));
Writeif( "-- HIGH Bearish Condition", x+1325, y+132); ---> error

//==============================================

Thanks before
 

Similar threads