Chào bác
@ranluc !
Mình mới cài lại ami mà cái chart Ichi trong đó dùng parameters không chuẩn.
Mình có "xoay sở" lấy code cũ để tạo custom nhưng nó báo bị lỗi không ra được chart. Lỗi
Với cái code mình đã dán trong ami như dưới đây. Nhờ bác xem và chỉnh giúp hoặc nếu bác có code để tạo chart Ichi với các tham số chuẩn (9. 26, 26, 26, 52) nhờ bác cho mình với.
_SECTION_BEGIN("Main Parameters");
p1 = Param("Turning Line",9,5,26,1);//also known as Tenkan Sen
p2 = Param("Standard Line",26,5,52,1);//also known as Kijun Sen
p3 = Param("Delayed Line",26,0,52,1);//also known as Chikou Span
p4 = Param("Cloud F-Bars",26,0,52,1);//also known as Chikou Span
_SECTION_END();
/*******************************************************************************************/
_SECTION_BEGIN("Buy and Sell Signals");
Strategy = ParamList("Strategy", List1 = "1: Tenkan Sen/Kijun Sen Cross");//,2: ,3: ,4: ,5: ",0);
MinStrength = ParamList("Min Signal Strength", List2 = "1 - Weak,2 - Mid,3 - Strong,4 - Only best",2);
for( i=0; i<10; i++) {if( StrExtract(List1, i) == Strategy ) SelectedStrategy = i+1; }
for( i=0; i<10; i++) {if( StrExtract(List2, i) == MinStrength ) SelectedMinStrength = i+1; }
BuyShape = Param("Buy Shape Typ",def_BuyShape,0,50,1);
SellShape = Param("Sell Shape Typ",def_SellShape,0,50,2);
Buyshapecolor = ParamColor("Buy Shape Color",def_BuyShapeColor);
Sellshapecolor = ParamColor("Sell Shape Color",def_SellShapeColor);
_SECTION_END();
/*******************************************************************************************/
_SECTION_BEGIN("Styles");
TLstyle = ParamStyle("Turning Line",styleThick);
SLstyle = ParamStyle("Standard Line",styleThick);
DLstyle = ParamStyle("Delayed Line",styleThick|styleNoTitle);
_SECTION_END();
/*******************************************************************************************/
GraphZOrder = 0;
AddICHIMOKU2(p1,p2,p3,p4);
HSB = 0;
/*******************************************************************************************/
if(HSB)
{
_SECTION_BEGIN("Cloud 1");
Hue = Param("Hue",90,0,255,1);
Saturation = Param("Saturation",255,0,255,1);
Brightness = Param("Brightness",60,0,255,1);
Cloud1color = ColorHSB(Hue,Saturation,Brightness);
_SECTION_END();
_SECTION_BEGIN("Cloud 2");
Hue = Param("Hue",0,0,255,1);
Saturation = Param("Saturation",180,0,255,1);
Brightness = Param("Brightness",125,0,255,1);
Cloud2color = ColorHSB(Hue,Saturation,Brightness);
_SECTION_END();
}
else
{
_SECTION_BEGIN("Colors");
TLcolor = ParamColor("Turning Line",def_Color3);
SLcolor = ParamColor("Standard Line",def_StandardLine);
DLcolor = ParamColor("Delayed Line",colorGrey50);
Cloud1color = ParamColor("Cloud 1",def_Cloud1color);
Cloud2color = ParamColor("Cloud 2",def_Cloud2color);
_SECTION_END();
}
/*******************************************************************************************/
//Strategy 1: Tenkan Sen/Kijun Sen Cross
MinTLSL = Min(TL,SL); MaxTLSL = Max(TL,SL);
BuyPositionTLSL_1 = IIf(MinTLSL > CloudHigh,3, IIf(MinTLSL > CloudLow AND MaxTLSL < CloudHigh,2,1));
SellPositionTLSL_1 = IIf(MaxTLSL < CloudLow,3, IIf(MinTLSL > CloudLow AND MaxTLSL < CloudHigh,2,1));
BuyStrength_1 = BuyPositionTLSL_1+IIf(RDL,1,-1);
SellStrength_1 = SellPositionTLSL_1+IIf(FDL,1,-1);
Buy_1 = Cross(TL,SL) AND BuyStrength_1 >= SelectedMinStrength;
Sell_1 = Cross(SL,TL) AND SellStrength_1 >= SelectedMinStrength;
Strength_1 = IIf(Buy_1,BuyStrength_1,IIf(Sell_1,SellStrength_1,0));
Interpretation = "\n"+"Strategy = " + "\n"+Strategy + "\n\n";
BuyInterpretation1 =
WriteIf(BuyPositionTLSL_1 == 3,"The cross happend above the cloud, this is a strong signal and gives 3 ranking points.",
WriteIf(BuyPositionTLSL_1 == 2,"The cross happend inside the cloud, this is a mid signal and gives 2 ranking points.",
WriteIf(BuyPositionTLSL_1 == 1,"The cross happend below the cloud, this is a weak signal and gives 1 ranking point.","")));
BuyInterpretation1 = BuyInterpretation1 +
WriteIf(BuyStrength_1 == BuyPositionTLSL_1+1,"\n\nDelayed line is above past close. This shows rising prices and gives 1 ranking point.",
WriteIf(BuyStrength_1 == BuyPositionTLSL_1-1,"\n\nDelayed line is below past close. This shows falling prices and gives -1 ranking point.",""));
SellInterpretation1 =
WriteIf(SellPositionTLSL_1 == 3,"The cross happend below the cloud, this is a strong signal and gives 3 ranking points.",
WriteIf(SellPositionTLSL_1 == 2,"The cross happend inside the cloud, this is a mid signal and gives 2 ranking points.",
WriteIf(SellPositionTLSL_1 == 1,"The cross happend above the cloud, this is a weak signal and gives 1 ranking point.","")));
SellInterpretation1 = SellInterpretation1 +
WriteIf(SellStrength_1 == SellPositionTLSL_1+1,"\n\nDelayed line is below past close. This shows falling prices and gives 1 ranking point.",
WriteIf(SellStrength_1 == SellPositionTLSL_1-1,"\n\nDelayed line is above past close. This shows rising prices and gives -1 ranking point.",""));
Interpretation = Interpretation +
WriteIf(Buy_1,Buyinterpretation1,WriteIf(Sell_1,Sellinterpretation1,""));
/*******************************************************************************************/
Buy = def_Buy AND Buy_1;
Sell = def_Sell AND Sell_1;
/*******************************************************************************************/
AddAlert(Buy,Audio,Email,"Standard line crossed Turning line",1,BarComplete,def_BuySound1);
AddAlert(Sell,Audio,Email,"Turning line crossed Standard line",2,BarComplete,def_SellSound1);
/*******************************************************************************************/
_SECTION_BEGIN("Lines");
Plot(TL, "TL", TLcolor,TLstyle);
Plot(SL, "SL", SLcolor,SLstyle);
Plot(DL, "DL", DLcolor,DLstyle);
PlotOHLC( 0, SpanA_ahead, SpanB_ahead, SpanB_ahead, "Cloud", IIf(SpanA_ahead>SpanB_ahead,Cloud1color,Cloud2color), styleCloud+styleNoTitle+styleNoLabel,Null,Null,p4 );
PlotShapes(BuyShape*Buy,BuyShapecolor,0,L,-def_BuyShapeOffset);
PlotShapes(SellShape*Sell,SellShapecolor,0,H,-def_SellShapeOffset);
_SECTION_END();
Cám ơn bác nhiều nhiều. Nice w/end to you!