![]() |
|
| Discuss Need Help for Composite MACD at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi Friends, Help required for AFL of MACD Composite, originally written by Mr. Jose Silva ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
Hi Friends,
Help required for AFL of MACD Composite, originally written by Mr. Jose Silva for Meta Stock.I have taken permission of Mr.Jose Silva regarding the same. Metastock formula is as under:- ==================== MACD - composite EMA ==================== ----------------------------------------------- { MACD or Histogram based on multiple EMA's } { Incorporating automatic overbought/oversold levels } { ©Copyright 2005 Jose Silva } { http://www.metastocktools.com } { User inputs } plot1:=Input("[1]MACD, [2]Histogram",1,2,1); plot2:=Input("[1]MACD/Hist, [2]Normalized", 1,2,1); pds:=Input("Signal/Histogram EMA periods", 2,260,21); { Composite-EMA MACD/Histogram } ema1:= Mov(C,3,E) +Mov(C,5,E) +Mov(C,8,E) +Mov(C,11,E) +Mov(C,14,E) +Mov(C,17,E); ema2:= Mov(C,30,E) +Mov(C,35,E) +Mov(C,40,E) +Mov(C,45,E) +Mov(C,50,E) +Mov(C,56,E); emaComp:=ema1-ema2; signal:=Mov(emaComp,pds,E); hist:=emaComp-signal; { Choose MACD or Histogram } MacdH:=If(plot1=1,emaComp,hist); { Normalized MACD/Histogram } normMod:=Highest(MacdH)-Lowest(MacdH); normMod:=If(normMod=0,.000001,normMod); MacdHnorm:= ((MacdH-Lowest(MacdH))/normMod-.5)*200; { Choose standard/normalized } MacdComp:=If(plot2=1,MacdH,MacdHnorm); signal:=Mov(MacdComp,pds,E); { MACD/Hist average } avg:=Cum(MacdComp)/Cum(IsDefined(MacdComp)); { MACD/Hist auto boundaries } pk:=Ref(MacdComp,-1)>MacdComp AND Ref(MacdComp,-1)>Ref(MacdComp,-2) AND Ref(MacdComp,-1)>avg; pkVal:=ValueWhen(1,pk,Ref(MacdComp,-1)); tr:=Ref(MacdComp,-1)<MacdComp AND Ref(MacdComp,-1)<Ref(MacdComp,-2) AND Ref(MacdComp,-1)<avg; trVal:=ValueWhen(1,tr,Ref(MacdComp,-1)); Obought:=Cum(pkVal)/Cum(IsDefined(pkVal)); Osold:=Cum(trVal)/Cum(IsDefined(trVal)); { Plot in own window } Obought; { Red } avg; { Grey } Osold; { Blue } If(plot1=1,signal,avg); { Green } MacdComp { Black } Formula of Metastock available at http://www.metastocktools.com/MetaStock/MACDHcomp.txt also. I have written part codes covering MACD and Signal in AFL as under:- // Composite MACD // Incorporating automatic overbought/oversold levels // ©Copyright 2005 Jose Silva ema1= EMA(C,3) +EMA(C,5) +EMA(C,8) +EMA(C,11) +EMA(C,14) +EMA(C,17); ema2= EMA(C,30) +EMA(C,35) +EMA(C,40) +EMA(C,45) +EMA(C,50) +EMA(C,56); emaComp=ema1-ema2; s=EMA(emaComp,21); Plot(S , "SIGNAL", colorRed); Plot(emaComp , "emaComp", colorBlue); Plot(0,"",colorBlack,styleLine); --------------------------------------------------- Unable to code for overbought/oversold. Help requested for the complete code with Overbought/sold levels. Thanks in advance. Hitash Pandya |
|
#3
|
|||
|
|||
|
Thank you very much Sir,
I have posted to Amibroker forum but yet not received any response. I have tried Purebyte also. I am used to this single indicator in Metastock that feeling uncomfortable and unable to work when I don't have the same in Amibroker. I will be greatful if you help me out. Thank you very much once again. |
|
#5
|
|||
|
|||
|
I have attached herewith file in Doc, step by step explaination.
I have tried to write afl code. I have also attahced that file in txt form. Thanks and Regards |
|
#6
|
|||
|
|||
|
I am also curious to know about this indicator.Can you please post chart using this indicator? Normally in
http://trader.online.pl/MSZ/!-MSZ-index-en.html examples of indicators are given but for this indicator, example is not available. Presuming normalisation same as stochastic, I have plotted stochastic and stochastic of macd in one pane. please check whether your indicator is similar to this. chart is enclosed |
|
#7
|
|||
|
|||
|
Thanks for your posting, but MACD Composite is different than the example you have send.
Pl find here attached chart showing indicator. - Thanks & Regards |
|
#8
|
|||
|
|||
|
Quote:
I enclose a text file. In this I have added to your formula ---peak and trough value calculations and buy and sell arrows in the chart. Further to this, Jose has done cumulative average of peak and trough values at any time and plotting this as historic cumulative overbought and oversold lines. I do not know how to do this. Hope biginner_av will help us further Regards |
|
#9
|
|||
|
|||
|
Quote:
a)compo macd test rev1.txt b) sample chart with above formula. In the previous formula, some errors were there. I have corrected them. Pl note following 1)Prepare new afl file with above formula. It gives comp macd indicator.In this indicator panel, drag and drop three 200ema's ---one each for fields emacomp, pkval and trval.You have to select these with suitable colour in the parameters. With this, you will get similar chart as in the sample. I could not get historical averages, by formula. Hence instead of that I am using 200ema for above fields. After using above, please enclose a chart for information. Also, pl inform how you use this indicator, for decision making for buy or sell, for information. Regards Last edited by kgsirasangi; 8th February 2007 at 11:09 PM. |
|
#10
|
|||
|
|||
|
Thanks for the afl.
I don't know why but visual effect is not same as in Metastock. Here is how I use the formula:- 1. Buy when MACD crosses upper most line. 2. To add to investment when:- a. MACD violates signal line and crosses back/again and still both the lines remains above the uppermost line. 3. To sell when MACD comes below 2nd line. 4. To short when MACD comes below lower most line. 5. To add to short when:- a. MACD crosses signal line in upwards direction and crosses back and still both the line remains below lower most lines. Example chart attached. |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: Need Help for Composite MACD
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MA vs MACD | sgkalai | Technical Analysis | 9 | 7th December 2007 12:01 AM |
| Macd | rahulg77 | MetaStock | 6 | 4th January 2007 03:16 PM |
| Session on MACD | rajesh.sadhanala | Technical Analysis | 5 | 22nd February 2006 04:33 PM |
| Macd | Masterchief | Technical Analysis | 5 | 31st May 2005 12:19 PM |
| Composite Leverage Index-beginners Must Know | sh50 | Risk & Money Management | 0 | 1st October 2004 10:08 AM |
Indemnity, Disclaimer & Disclosure
Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum
Rules Disclaimer & Disclosure and indemnify Traderji.com, its
associates and related parties of all claims howsoever resulting from
the usage of the forum.
• Disclaimer: Trading or investing in stocks & commodities
is a high risk activity. Any action you choose to take in the markets
is totally your own responsibility. Traderji.com will not be liable for
any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
• Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein.
The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.