Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
MACD Multiple Time Frame Exploration for Amibroker (AFL)
This is an exploration formula for when the MACD indicator crosses it’s signal line in many different time frames. Daily, weekly, monthly and quarterly are supported.
Indicator / Formula
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //********************************************************** MACD DAILY, WEEKLY, MONTHLY & QUARTERLY *************************************************** //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// _SECTION_BEGIN("Daily"); TimeFrameSet(inDaily); MACD_d=MACD(12, 26); Signal_d=Signal(12, 26, 9); Ind_day = WriteIf(Cross(MACD_d, Signal_d),"1.C.OverUp", WriteIf(Cross(Signal_d, MACD_d),"3.C.OverDown", WriteIf(MACD_d >= Signal_d,"2.Up", WriteIf(Signal_d > MACD_d,"4.Down","5.Neutral")))); Ind_day_cColor = IIf(Cross(MACD_d, Signal_d), colorBrightGreen, IIf(Cross(Signal_d, MACD_d), colorRed,IIf(MACD_d >= Signal_d, colorGreen, IIf(Signal_d > MACD_d, colorDarkRed,colorDefault)))); AddTextColumn(Ind_day,"Day ", 1, colorDefault, Ind_day_cColor); TimeFrameRestore(); _SECTION_END(); _SECTION_BEGIN("Weekly"); TimeFrameSet(inWeekly); MACD_w=MACD(12, 26); Signal_w=Signal(12, 26, 9); Ind_week = WriteIf(Cross(MACD_w, Signal_w),"1.C.OverUp", WriteIf(Cross(Signal_w, MACD_w),"3.C.OverDown", WriteIf(MACD_w >= Signal_w,"2.Up", WriteIf(Signal_w > MACD_w,"4.Down","5.Neutral")))); Ind_week_cColor = IIf(Cross(MACD_w, Signal_w), colorBrightGreen, IIf(Cross(Signal_w, MACD_w), colorRed,IIf(MACD_w >= Signal_w, colorGreen, IIf(Signal_w > MACD_w, colorDarkRed,colorDefault)))); AddTextColumn(Ind_week,"Week ", 1, colorDefault, Ind_week_cColor); TimeFrameRestore(); _SECTION_END(); _SECTION_BEGIN("Monthly"); TimeFrameSet(inmonthly); MACD_m=MACD(12, 26); Signal_m=Signal(12, 26, 9); Ind_month = WriteIf(Cross(MACD_m, Signal_m),"1.C.OverUp", WriteIf(Cross(Signal_m, MACD_m),"3.C.OverDown", WriteIf(MACD_m >= Signal_m,"2.Up", WriteIf(Signal_m > MACD_m,"4.Down","5.Neutral")))); Ind_month_cColor = IIf(Cross(MACD_m, Signal_m), colorBrightGreen, IIf(Cross(Signal_m, MACD_m), colorRed,IIf(MACD_m >= Signal_m, colorGreen, IIf(Signal_m > MACD_m, colorDarkRed,colorDefault)))); AddTextColumn(Ind_month,"Month ", 1, colorDefault, Ind_month_cColor); TimeFrameRestore(); _SECTION_END(); _SECTION_BEGIN("Quarterly"); TimeFrameSet(inquarterly); MACD_q=MACD(12, 26); Signal_q=Signal(12, 26, 9); Ind_quarter = WriteIf(Cross(MACD_q, Signal_q),"1.C.OverUp", WriteIf(Cross(Signal_q, MACD_q),"3.C.OverDown", WriteIf(MACD_q >= Signal_q,"2.Up", WriteIf(Signal_q > MACD_q,"4.Down","5.Neutral")))); Ind_quarter_cColor = IIf(Cross(MACD_q, Signal_q), colorBrightGreen, IIf(Cross(Signal_q, MACD_q), colorRed,IIf(MACD_q >= Signal_q, colorGreen, IIf(Signal_q > MACD_q, colorDarkRed,colorDefault)))); AddTextColumn(Ind_quarter,"Quarterly ", 1, colorDefault, Ind_quarter_cColor); TimeFrameRestore(); _SECTION_END(); macdtot= IIf(MACD_d>=Signal_d, 1, 0)+ IIf(MACD_w>=Signal_w, 10, 0)+ IIf(MACD_m>=Signal_m, 100, 0)+ IIf(MACD_q>=Signal_q, 1000, 0); AddColumn (macdtot, "MACDTotal", 1, colorDefault, colorDefault); macdcont= IIf(MACD_d>=Signal_d, 1, 0)+ IIf(MACD_w>=Signal_w, 1, 0)+ IIf(MACD_m>=Signal_m, 1, 0)+ IIf(MACD_q>=Signal_q, 1, 0); AddColumn (macdcont, "MACDCount", 1, colorDefault, colorDefault); Filter = 1;
14 comments
Leave Comment
Please login here to leave a comment.
Back
Version 6.02 does not work
It has been fixed.
The equation has been fixed Thank you
Hi Mohangbox,
If I need to add Intraday MACD (5, 15 minutes, Hourly) in the indicator.
Please kindly to inform how to write?
Thanks much
Hi All,
I am a new AFL programmer.
Somebody can help me If I need to add Intraday MACD (5, 15 minutes, 2 Hours) in the indicator.
Please kindly to inform how to write?
I got error message for this
Thanks much
not working on 6.2 V
Was working fine last time I tested in Amibroker 6.2
This is perfect. can you make another one exactly like this but add STOCHASTIC daily weekly monthly? thanks
Hi All,
The above code should work all Amibroker tool.
Most of them tried for Intraday like 5mins 15mins horuly, You can change
_SECTION_BEGIN(“5Minute”);
TimeFrameSet(in5Minute);
********
TimeFrameRestore();
_SECTION_END();
_SECTION_BEGIN(“15Minute”);
TimeFrameSet(in15Minute);
********
TimeFrameRestore();
_SECTION_END();
_SECTION_BEGIN(“Hourly”);
TimeFrameSet(inHourly);
********
TimeFrameRestore();
_SECTION_END();
I hope this is helpful your questions.
Can any one help me for Intraday data for Amibroker? Did we have any DLL plugin to get intraday data? I will share more Intraday code once validated with Intraday data. For sharing the info or clarifications to mohangbox@gmail.com. Thanks
Thank you for your answer Mr Mohangbox
But i still got difficult for 4 Hours MAcd.
It can not work.
Please could you fixed the problem.
Here my code for $ Hours.
Thank you before
SOLVED, Thanks
Hi All,
I am a new to AFL programming.
Can somebody can help me to add Intraday MACD (15, 1Hour, 3 Hours) in the indicator.
I have tried below cod but its not working,
Thanks.
Someone copy & Paste it from here to http://marketsecrets.in/script-library/amibroker-afl-script-library/afl-for-macd-multiple-time-frame/ as same code…..