Hello Experts,
Please help me to fix a problem which I am not able to do for a long time.
No show Error number !!!!
Please let me know the problem here !
Thank you so much !!
My code as below :
_SECTION_BEGIN("MO HINH HOA LOA KEN");
GraphXSpace =25;
Length = 20;
Price = EMA(Close, Length);
Plot(C,"",IIf(C>Ref(C,-1),colorCustom9,colorRed),styleCandle);
Plot(MA( C, 20 ),"MA20",colorYellow,styleLine|styleThick);
Plot(EMA( C, 6 ),"EMA6",colorCustom15,styleThick);
Plot(EMA( C, 10 ),"EMA10",colorCustom9,styleThick);
Plot(EMA( C, 150 ),"EMA150",colorCustom8,styleLine|styleDots);
Plot(MA( C, 65 ),"MA65",colorCustom12,styleLine|styleThick);
Plot(MA( C, 50 ),"MA50",colorCustom11,styleLine|styleThick);
Plot(MA( C, 200 ),"MA200",colorBrown,styleThick);
Plot(MA( C, 250 ),"MA250",ParamColor("Color",colorCustom16),styleThick);
kLength = Length;
kN = 1.5;
kATR = ATR(kLength);
kUpper = Price + kN * kATR;
kLower = Price - kN * kATR;
bbLength = Length;
bbN = 2;
bbStDevValues = StDev(Close, bbLength);
bbUpper = Price + bbN * bbStDevValues;
bbLower = Price - bbN * bbStDevValues;
kUpper2 = Price - kN * kATR;
kLower2 = Price + kN * kATR;
bbUpper2 = Price - bbN * bbStDevValues;
bbLower2 = Price + bbN * bbStDevValues;
IsBBSqueeze = bbUpper <= kUpper AND bbLower >= kLower;
Proportion = ((kUpper - kLower) / (bbUpper - bbLower)) ;
Proportion2 = ((kUpper2 - kLower2) / (bbUpper2 - bbLower2)) ;
BBBreakout = Cross(1,Proportion) AND C>MA(C,20) AND C>=Ref(bbUpper,-1);
BBBreakoff = Cross(1,Proportion2) AND C<MA(C,20) AND C<=Ref(bbLower,-1);
BBBreakout2 = Cross(1,Proportion);
Periods = Param("BBPeriods", 20, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Màu", colorCustom1 );
Style = ParamStyle("Kieu");
bbtop=BBandTop( C, Periods, Width ) ;
bbbot=BBandBot( C, Periods, Width );
Plot(bbtop, "", color, style );
Plot(bbbot , "", color, style );
sqeezcolor=ColorRGB(194,220,218);
PlotOHLC( bbtop,bbtop, bbbot,bbbot, "",IIf(IsBBSqueeze,colorCustom1,colorDarkGrey), styleCloud|styleNoRescale, Null, Null, Null, -1 );
Buy = BBBreakout;
Sell = BBBreakoff;
PlotShapes( shapeUpArrow * BBBreakout, colorBlue, 0,Low);
PlotShapes( shapedownArrow * BBBreakoff, colorBlue, 0,Low);
AlertIF( Buy, "SOUND C:\\D-AmiBroker\\music\\hoa loa ken mua.wav", "Audio alert", 3 );
AlertIF( Sell, "SOUND C:\\D-AmiBroker\\music\\hoa loa ken ban.wav", "Audio alert", 4 );
//% gia
Chg = ROC( C, 1 );
ChgV = ROC( V, 1 );
AddColumn(C, "Gia", 1.2, IIf(Chg >= 0, colorGreen, colorRed),-1);
AddColumn(V, "Khoi Luong", 1, IIf(chgv>= 0, colorGreen, colorRed),-1);
AddColumn(ChgV, "% KL", 1, IIf(ChgV >= 0, colorGreen, colorRed),-1);
AddColumn(Chg, "% Gia", 1.2, IIf(Chg >= 0, colorGreen, colorRed),-1);
//end %gia
TextList = "KHONG\nCO";
AddMultiTextColumn(BBBreakout, TextList, "BREAKOUT", 1.2,IIf(BBBreakout, colorGreen, colorRed),colorWhite,-1);
AddMultiTextColumn(BBBreakout2, TextList, "SIDEWAY TICH LUY" , 1.2,IIf(BBBreakout2, colorGreen, colorRed),colorWhite,-1);
AddMultiTextColumn(BBBreakoff, TextList, "BREAKDOWN", 1.2,IIf(BBBreakoff, colorGreen, colorRed),colorWhite,-1);
Filter = BBBreakout OR BBBreakoff OR BBBreakout2;
_SECTION_END();