zhenming 發表於 19-8-6 12:19

求助~可否幫我把 MACD 的柱狀線加顏色?


好心的大人~~
不知為何照著舊帖教學的部分,怎麼改就是不行,可否拜託好心的大人幫幫忙~~
感激不盡~~

幫我把 MACD 的柱狀線加顏色?
-為綠色、+為紅色
謝謝



_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorDefault ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
_SECTION_END();



kuolung 發表於 19-8-6 14:20

Plot( ml-sl, "MACD Histogram", IIf((ml > sl ), colorRed, colorGreen), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );


zhenming 發表於 19-8-6 14:34

kuolung 發表於 19-8-6 14:20
Plot( ml-sl, "MACD Histogram", IIf((ml > sl ), colorRed, colorGreen), styleNoTitle | ParamStyle("His ...

感謝大師的幫忙
確實是成功了~~~
實在是幫大忙了~~


頁: [1]
查看完整版本: 求助~可否幫我把 MACD 的柱狀線加顏色?