請參考
_SECTION_BEGIN("客製化 K 線");
HaClose = EMA((O+H+L+C)/4,3); // Woodie
HaOpen = AMA(Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max(HaClose,HaOpen ) );
HaLow = Min( L, Min(HaClose,HaOpen ) );
mycolor=IIf(HaClose>=C AND HaOpen<O, colorPink,
IIf(HaClose<C AND HaOpen>=O,colorSkyblue,
IIf(HaClose>=C and HaOpen>=O,colorRed,
IIf(HaClose<C AND HaOpen<O,colorPaleGreen,colorGreen))));
SetBarFillColor(myColor);
barColor=IIf(HaClose>HaOpen ,colorRed,IIf(HaClose<HaOpen,colorGreen,colorBlue));
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "客製化 K 線" , barColor, styleCandle | styleThick );
_SECTION_END();
HaOpen, HaHigh, HaLow and HaHigh的公式是可以改的
以上範例的圖形如下
客製化 K 線
|