Xin trợ giúp về code Amibroker

Discussion in 'Amibroker, Metatrader, MetaStock, TradeStation &' started by dungkhdt, Nov 5, 2015.

  1. phieudu

    phieudu New Member

    Joined:
    Oct 29, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    mình cũng tìm suốt trong đấy mà ko thấy, search tìm trên mạng cũng ko thấy bài viết nào nói nên mới hỏi mọi người
     
  2. Tin

    Tin Well-Known Member

    Joined:
    Jul 9, 2016
    Messages:
    213
    Likes Received:
    420
    Trophy Points:
    63
    em muốn học code Ami từ vỡ lòng. Các bác có thể share kinh nghiệm hoặc tài liệu để em có thể biết bắt đầu từ đâu được không?
     
  3. wisebull

    wisebull Well-Known Member

    Joined:
    Nov 8, 2011
    Messages:
    107
    Likes Received:
    336
    Trophy Points:
    63
    Chào cả nhà!
    Mình có lưu cái Ichimoku code như này, mà sao nó ko work, có bác nào chỉnh sửa dùm với, cám ơn nhiều!
    //|-----------------------------------------------------------------------------------------

    //|PatternExplorer.com - Ichimoku Chart

    //|Copyright © 2007, PatternExplorer.com

    //|http://www.PatternExplorer.com

    //|e-mail: support@PatternExplorer.com

    //|-----------------------------------------------------------------------------------------

    FormulaName = "PE - Ichimoku Chart";


    SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);

    #pragma nocache

    #include_once <\PEInc\PatternExplorer_f0.afl>

    #include_once"C:\Program Files (x86)\AmiBroker\Formulas\PatternExplorer\#Defaults & Mods\PE - Defaults.afl"

    #include_once"C:\Program Files (x86)\AmiBroker\Formulas\PatternExplorer\#Defaults & Mods\PE - Mods.afl"

    /*******************************************************************************************/

    AddCustomCodeBeforePE();

    /*******************************************************************************************/

    AddAlertParam(def_AudioAlert,def_EmailAlert,def_BarComplete);

    /*******************************************************************************************/

    _SECTION_BEGIN("Main Parameters");

    p1 = Param("Turning Line",9,5,20,1);//also known as Kijun Sen

    p2 = Param("Standard Line",26,5,40,1);//also known as Tenkan Sen

    p3 = Param("Delayed Line",26,0,40,1);//also known as Chikou Span

    p4 = Param("Cloud F-Bars",26,0,40,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();

    }

    /*******************************************************************************************/

    #include_once <\PEInc\PatternExplorer_1.afl>

    GraphZOrder = 0;

    /*******************************************************************************************/

    //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();

    /*******************************************************************************************/

    Filter = def_Filter AND NOT GroupID()==253;

    Filter = Filter AND (Buy OR Sell);

    Addefaultcolumns();

    Adddefaultcolumns(2,1);

    AddColumn(Strength_1,"Signal Strength",1.0);

    AddTextColumn(FullName(),"Full name");

    /*******************************************************************************************/

    ToolTip = def_ToolTip+WriteIf(Buy,"\n\n"+"Signal = Buy, "+"Signal strength = " + WriteVal(Strength_1,1.0),WriteIf(Sell,"\n\n"+"Signal = Sell, "+"Signal strength = " + WriteVal(Strength_1,1.0),""))+"\n"+interpretation;

    /*******************************************************************************************/

    AddCustomCodeAfterPE();

    /*******************************************************************************************/

    Title = "PatternExplorer.com - Ichimoku Chart" + default_priceTitle + " ";
     
  4. chim_non

    chim_non Moderator

    Joined:
    Nov 1, 2011
    Messages:
    33,721
    Likes Received:
    141,335
    Trophy Points:
    113
    Không hiểu rõ ý bác nó không chạy là thế nào? Bác không vẽ được đồ thị Ichimoku hay không chạy được phần báo mua/bán của Pluggin này?
    Nếu chỉ là vẽ đồ thị Ichimoku không thôi thì đơn giản, bác tạo 1 file .AFL mới và copy đoạn code dưới đây vào là xong:
    _SECTION_BEGIN("Price");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
    _SECTION_END();

    _SECTION_BEGIN("Ichimoku");
    kijunsen = ( HHV( H, 26 ) + LLV( L, 26) )/2;// standard, base, or kijun-sen line
    tenkansen = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
    chikou = C; // delayed, lagging, or chikou span
    SpanA = (( kijunsen + tenkansen )/2);// senkou span A, kumo, or clouds
    SpanB = (HHV( H, 52) + LLV(L, 52))/2;// senkou span B, kumo, or clouds

    Plot(kijunsen,"Kijun Sen",32,styleThick); // standard, base, or kijun-sen line
    Plot(tenkansen,"Tenkan Sen",27,styleThick); // turning, conversion, or tenkan-sen line
    Plot(chikou ,"Chikou Span",38,styleThick,Null,Null,-25); // delayed, lagging, or chikou span
    Plot(SpanA,"Senkou Span A",colorGreen,1,0,0,26); // senkou span A, kumo, or clouds
    Plot(SpanB,"Senkou Span B",colorSeaGreen,1,0,0,26); // senkou span B, kumo, or clouds
    PlotOHLC(SpanA,SpanB,SpanA,SpanB,"Kumo",IIf(SpanA>SpanB,colorSeaGreen,colorLightOrange),styleCloud|4096,0,0,26); //Kumo clouds
    _SECTION_END();
     
    Last edited: Apr 19, 2020
    mtp and wisebull like this.
  5. wisebull

    wisebull Well-Known Member

    Joined:
    Nov 8, 2011
    Messages:
    107
    Likes Received:
    336
    Trophy Points:
    63
    Cám ơn bác Chym_không già nhiều!
    Ý mình là nó ko vẽ ra chart được, mà code này lưu từ thời Bang Chủ chứ đâu phải hàng giả, hihi.
     
  6. chim_non

    chim_non Moderator

    Joined:
    Nov 1, 2011
    Messages:
    33,721
    Likes Received:
    141,335
    Trophy Points:
    113
    Vẽ Ichimoku chart không thôi thì đơn giản mà, đâu cần phải quá rối rắm như cái đoạn pluggin của BC đâu. Cơ bản là bác đọc chart ngắm tranh thế nào thôi.
     
    wisebull likes this.
  7. BlueDiamond

    BlueDiamond Well-Known Member

    Joined:
    Nov 1, 2011
    Messages:
    5,199
    Likes Received:
    18,853
    Trophy Points:
    113
    _SECTION_BEGIN("New formula");

    SetChartOptions(0,chartShowArrows|chartShowDates);

    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

    Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

    if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )

    {

    ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));

    }


    SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;

    TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;

    //DL = Ref( C, 26 );

    DL=C;

    Span1 = (( SL + TL )/2);

    Span2 = (HHV( H, 52) + LLV(L, 52))/2;


    Plot(SL,"SL",colorRed,styleThick);

    Plot(TL,"TL",colorBlue,styleThick);

    Plot(DL,"",colorIndigo,styleLine|styleThick,Null,Null,-22);

    Plot(Span1,"",colorBrown,1,0,0,26);

    Plot(Span2,"",colorOrange,1,0,0,26);

    PlotOHLC(Span1,Span2,Span1,Span2,"",IIf(Span1>Span2,colorLime,colorOrange),styleCloud|4096,0,0,26);

    _SECTION_END();
     
    wisebull likes this.
  8. BlueDiamond

    BlueDiamond Well-Known Member

    Joined:
    Nov 1, 2011
    Messages:
    5,199
    Likes Received:
    18,853
    Trophy Points:
    113
    Ichi dùng cái này cũng được ạ!
     
    wisebull likes this.
  9. wisebull

    wisebull Well-Known Member

    Joined:
    Nov 8, 2011
    Messages:
    107
    Likes Received:
    336
    Trophy Points:
    63
    Cám ơn các bác nhiều!
    Được voi rồi iem phấn khởi xin nốt Hai Bà ạ: các bác cho xin thêm cái code nào để lọc những mã có MA20 cắt MA50 từ dưới lên với (giao cắt vàng theo lời BC nói năm xưa), hihi...
    nea.png
     
    Last edited: May 7, 2020
  10. Tin

    Tin Well-Known Member

    Joined:
    Jul 9, 2016
    Messages:
    213
    Likes Received:
    420
    Trophy Points:
    63
    anh có thể code giúp em filter Giá vượt mây được không? em cám ơn
     
  11. hongstock

    hongstock New Member

    Joined:
    Nov 12, 2014
    Messages:
    3
    Likes Received:
    5
    Trophy Points:
    3
    Plot( C, "Close", IIf(C>Ref(C,-1),colorCustom9,colorRed), ParamStyle("Style") | GetPriceStyle() );
    _SECTION_BEGIN("i");
    /* ICHIMOKU CHART */
    n1 = Param("1",9,1,200,1);
    n2 = Param("2",26,1,400,1);
    n3 = Param("3",52,1,600,1);
    TenkanSen =(HHV(H,n1)+LLV(L,n1))/2;
    KijunSen =(HHV(H,n2)+LLV(L,n2))/2;
    ChinkouSpan =Ref(C,-n2);
    Cks = Close;
    SenkouSpanA =Ref((KijunSen+TenkanSen)/2,-n2);
    SpA =(KijunSen+TenkanSen)/2;
    SenkouSpanB =Ref((HHV(H,n3)+LLV(L,n3))/2,-n2);
    SpB =(HHV(H,n3)+LLV(L,n3))/2;
    DL = Ref( C, 25 );
    Cond1 = Ref(Close > Max(SenkouSpanA,SenkouSpanB),-1);
    Cond2 = Ref(Close < Min(SenkouSpanA,SenkouSpanB),-1);
    Cond3 = Ref(Cross(TenkanSen,KijunSen),-1);
    Cond4 = Ref(Cross(KijunSen,TenkanSen),-1);
    Cond5 = Ref(Cross(Close,ChinkouSpan ),-1);
    Cond6 = Ref(Cross(ChinkouSpan ,Close),-1);
    Cond7 = Ref(Cross (Close , Max(SenkouSpanA,SenkouSpanB)),-1);
    Cond8 = Ref(Cross ( Min(SenkouSpanA,SenkouSpanB), Close),-1);
    Cond9 = Close > TenkanSen AND TenkanSen > KijunSen AND KijunSen > Max(SenkouSpanA,SenkouSpanB);
    Cond10= Close < TenkanSen AND TenkanSen < KijunSen AND KijunSen < Min(SenkouSpanA,SenkouSpanB);
    RemCond9=ExRem(Cond9,NOT Cond9);
    RemCond10=ExRem(Cond10,NOT Cond10);
    ColSenk =IIf (Cond1,colorGreen, IIf(Cond2,colorRed,colorLightGrey));
    Flat = TenkanSen == Ref(TenkanSen,-1) OR (NOT(Cond1) AND NOT(Cond2)) ;
    for( i = 0; i < BarCount; i++ )
    {
    if (Flat)
    ColTenk = colorLightGrey;
    else
    {
    if (Cond1 AND TenkanSen > TenkanSen[i-1])
    ColTenk = colorGreen;
    if (Cond1 AND TenkanSen < TenkanSen[i-1])
    ColTenk = colorRed;
    if (Cond2 AND TenkanSen < TenkanSen[i-1])
    ColTenk = colorRed;
    if (Cond2 AND TenkanSen > TenkanSen[i-1])
    ColTenk = colorGreen;
    }
    }
    //PlotShapes(IIf(Cond7, shapeSmallUpTriangle ,shapeNone),colorGreen,0,H,10);
    //PlotShapes(IIf(Cond8, shapeSmallDownTriangle ,shapeNone),colorRed,0,L,10);
    //PlotShapes(IIf(Cond3, shapeHollowSmallUpTriangle,shapeNone),colorGreen,0,H,12);
    //PlotShapes(IIf(Cond4, shapeHollowSmallDownTriangle ,shapeNone),colorRed,0,L,12);
    PlotShapes(IIf(Cond5, shapeSmallCircle ,shapeNone),colorGreen,0,H,4);
    PlotShapes(IIf(Cond6, shapeSmallCircle + shapePositionAbove ,shapeNone),colorRed,0,L,4);
    PlotShapes(IIf(RemCond9 , shapeHollowSquare ,shapeNone),colorGreen,0,H,18);
    PlotShapes(IIf(RemCond10, shapeHollowSquare + shapePositionAbove ,shapeNone),colorRed,0,L,18);
    //Plot (C,"Close",colorBlack,styleThick);
    //Plot (C,"Bars",colorBlack,styleCandle);
    Plot (TenkanSen,"Tenkan-sen",colorRed);
    Plot (KijunSen, "Kijun-sen", colorBlue);
    Plot (Cks,"Chinkou Span",colorLime, style = styleLine,0,0,-n2);
    Plot (SpA,"SenkouSpanA",colorOrange,styleDashed,0,0,n2);
    Plot (SpB,"SenkouSpanB",colorViolet,styleDashed + styleThick,0,0,n2);
    PlotOHLC (SpA,SpA,SpB,SpB,"Cloud",IIf (SpA > SpB,ColorRGB( 64, 128, 128 ),ColorRGB( 128, 128, 128 )),styleCloud, 10, 10, n2 );
    above = IIf(KijunSen>SenkouSpanA AND TenkanSen>SenkouSpanB,1,0);
    within = IIf(KijunSen>SenkouSpanA AND TenkanSen<SenkouSpanB,1,0);
    below = IIf(TenkanSen<SenkouSpanA AND TenkanSen<SenkouSpanB,1,0);
    DK1 = C> SenkouSpanB;
    DK2 = (SpB > SpA);
    DK3 = (SenkouSpanB > SenkouSpanA);
    DK4 = Cross(C, SenkouSpanB) OR Cross(C, SenkouSpanA);
    Buy = DK1 AND DK3 AND DK4;
    PlotShapes( shapeUpArrow * Buy ,6,0,L,Offset=-15);
    DK5 = MA(V, 20) > 10000;
    Cover = Buy AND DK5;
    Filter = Cover OR Buy;
    AddColumn(V,"Khoi Luong",1.0);
    AddColumn(Cover,"Break Out Vuot May",True,colorCustom2,colorCustom6);
    Buy = Cross(TenkanSen,KijunSen) AND (DL>Close);
    Sell = Cross(KijunSen,TenkanSen) AND (DL<KijunSen);
    StrongBuy = Buy AND above;
    MediumBuy = Buy AND within;
    WeakBuy = Buy AND below;
    StrongSell = Sell AND below;
    MediumSell = Sell AND within;
    WeakSell = Sell AND above;

    IIf( (StrongBuy),PlotShapes(shapeUpTriangle*StrongBuy,colorGreen),0);
    IIf( (MediumBuy),PlotShapes(shapeUpArrow*MediumBuy,colorGreen),0);
    IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0);
    IIf( (StrongSell),PlotShapes(shapeDownTriangle*StrongSell,colorRed),0);
    IIf( (MediumSell),PlotShapes(shapeDownArrow*MediumSell,colorRed),0);
    IIf( (WeakSell),PlotShapes(shapeHollowDownArrow*WeakSell,colorBrown),0);
    _SECTION_END();
     
    mtp and chim_non like this.
  12. hongstock

    hongstock New Member

    Joined:
    Nov 12, 2014
    Messages:
    3
    Likes Received:
    5
    Trophy Points:
    3
    code vuot may day ban
     
  13. ngtheanh1996

    ngtheanh1996 New Member

    Joined:
    Jul 28, 2020
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Các hàm của Ami có mô tả trong phần Help. Nên đọc qua một lần trong đời.
     
  14. mtp

    mtp Well-Known Member

    Joined:
    Nov 1, 2011
    Messages:
    725
    Likes Received:
    1,395
    Trophy Points:
    93
    Oh
    Cám ơn Mod @chim_non quá.
    Đúng cái em đang đi tìm. Nice w/end
    Nhưng màu dùng cho các đường chưa đúng như tương quan ngũ hành (Tenkan đỏ/ Kijun - xanh blue, Chikou - xanh lá . Mây tăng màu xám - hành kim & mây giảm màu vàng - hành thổ).
    Bác có chỉnh lại giúp được không?
     
    Last edited: Aug 22, 2020
  15. mtp

    mtp Well-Known Member

    Joined:
    Nov 1, 2011
    Messages:
    725
    Likes Received:
    1,395
    Trophy Points:
    93
    Mod@chim_non ơi, em đã mò mẫm và chỉnh lại được màu của các đường Ichi theo tương quan ngũ hành.
    Mạn phép gửi lên đây cho ai cũng "cố chấp" như em.

    _SECTION_BEGIN("Price");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
    _SECTION_END();

    _SECTION_BEGIN("Ichimoku");
    kijunsen = ( HHV( H, 26 ) + LLV( L, 26) )/2;// standard, base, or kijun-sen line
    tenkansen = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
    chikou = C; // delayed, lagging, or chikou span
    SpanA = (( kijunsen + tenkansen )/2);// senkou span A, kumo, or clouds
    SpanB = (HHV( H, 52) + LLV(L, 52))/2;// senkou span B, kumo, or clouds

    Plot(kijunsen,"Kijun Sen",29,styleThick); // standard, base, or kijun-sen line
    Plot(tenkansen,"Tenkan Sen",32,styleThick); // turning, conversion, or tenkan-sen line
    Plot(chikou ,"Chikou Span",27,styleThick,Null,Null,-25); // delayed, lagging, or chikou span
    Plot(SpanA,"Senkou Span A",colorLightYellow,1,0,0,26); // senkou span A, kumo, or clouds
    Plot(SpanB,"Senkou Span B",colorLightGrey,1,0,0,26); // senkou span B, kumo, or clouds
    PlotOHLC(SpanA,SpanB,SpanA,SpanB,"Kumo",IIf(SpanA>SpanB,colorLightOrange,colorLightGrey),styleCloud|4096,0,0,26); //Kumo clouds
    _SECTION_END();
     

Share This Page

XenForo Add-ons by Brivium ™ © 2012-2013 Brivium LLC.