![]() |
|
| Discuss Need Help for Composite MACD at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Originally Posted by hitesh Thanks for the afl. I don't know why but visual effect ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#11
|
|||
|
|||
|
Quote:
1) sample chart. 2) compo macd test rev2 In my chart I have used this formula. Instead of ema's, I have used ma's. Jose also has used ma's. Also, instead of 200ma of emacomp, I have used 200ma of pkvaltrvalavg field. This gives middle line better. In the charts enclosed by you, look is different ---may be due to lot of price variation?. Please check on ntpc chart. Look may be similar to as posted by you earlier. Regards Last edited by kgsirasangi; 10th February 2007 at 06:37 AM. |
|
#12
|
|||
|
|||
|
Thanks a lot.
In the chart forwarded by you, it gives perfect reading. But when I copy formula and plot into chart it gives different effect. I am attaching chart of VSNL (3 minutes), the chart of same scrip attahced by you. In the chart forwarded by you, these three lines never meets each other, whereas in this case, there is a overlapping. May I request you to forward me the formula you are using as it is? Regards. Last edited by hitesh; 11th February 2007 at 03:08 PM. |
|
#13
|
|||
|
|||
|
hitesh,
1) your present afl is ok, but it needs to be modified as follows. 2) In my afl formula, I have given colorwhite for following (to make them invisible) Plot(pkval ,"pkval",colorWhite) ; Plot(trval ,"trval",colorWhite) ; Plot(pkvaltrvalavg ,"pkvaltrvalavg",colorWhite) ; You have modified them as colorblack. Modify them back as colorwhite. Do not delete them as they are required to calculate ma's as mentioned below. With this, these fields will remain in chart but as invisible. 3) Now drag and drop three 200ma's (not ema's) in this indicator pane, one each for pkval,trval and pkvaltrvalavg and modify their color( other than white), field, period from parameters. as done earlier. Now your chart will be similar to mine. Regards Last edited by kgsirasangi; 11th February 2007 at 06:13 PM. |
|
#14
|
|||
|
|||
Thanks a lot Sir, It is coming perfectly. And visual effect is also as metastock. I am relived. Thank you very much once again. Regards |
|
#15
|
|||
|
|||
|
OK. Glad to know you are getting chart as desired.
|
|
#16
|
|||
|
|||
|
No friends,
I cant help much. I got the following already with parameters. But I just cant understand what the hell is Cum(pkVal)/Cum(pkVal), cos it alwats gives 1... ************************ // Composite MACD // Incorporating automatic overbought/oversold levels // ©Copyright 2005 Jose Silva //Modified to adapt for amibroker Plot1 = Param("1M 2Hist", 1, 1, 2, 0.5); Plot2 = Param("1M Hist, 2Norm", 1, 1, 2, 0.5); pds = Param("Sig Hist EMApds", 2, 2, 260, 21); 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,pds); hist = emaComp - s; //MacdH = IIf(Plot1 = 1, emaComp, hist); if (Plot1 = 1) { MacdH = emaComp; } else if (Plot1 = 2) { MacdH = hist; } //{ Normalized MACD/Histogram } normMod = Highest(MacdH)- Lowest(MacdH); normMod = IIf(normMod = 0, .000001, normMod); MacdHnorm = ((MacdH- Lowest(MacdH))/normMod-.5)*200; //{ Choose standard/normalized } //MacdComp = IIf(Plot2 = 1, MacdH, MacdHnorm); if (Plot2 = 1) { MACDComp = MacdH; } else if (Plot2 = 2) { MACDComp = MacdHnorm; } s = EMA(MacdComp,pds); //{ MACD/Hist average } //MACDComp0check = IsTrue(MACDComp); //if (MACDComp0check = 1) //{ Avg1 = Cum(MacdComp)/Cum(MacdComp); //} //else //{} //; //{ MACD/Hist auto boundaries } pk = Ref(MacdComp,-1)> MacdComp AND Ref(MacdComp,-1) > Ref(MacdComp,-2) AND Ref(MacdComp,-1)> Avg1; pkVal = ValueWhen(pk, Ref(MacdComp,-1), 1); tr = Ref(MacdComp,-1)<MacdComp AND Ref(MacdComp,-1)<Ref(MacdComp,-2) AND Ref(MacdComp,-1) < Avg1; trVal = ValueWhen(tr,Ref(MacdComp,-1), 1); pkVal0check = IsTrue(pkVal); //if (pkVal0check = 1) //{ Obought = Cum(pkVal)/Cum(pkVal); //} //else //{}; Osold = Cum(trVal)/Cum(trVal); //{ Plot in own window } Plot(Obought, "overbought", colorRed); Plot(Avg1, "Average", colorLightGrey); Plot(Osold, "oversold", colorBlue); p1 = IIf(Plot1 = 1, s, Avg1); Plot(p1, "Chosen signal/average", colorGreen ); Plot(MacdComp, "MACD Composite", colorBlack); |
|
#17
|
|||
|
|||
|
biginner_av,
Thank you for your help. Presently, hitesh"s problem is solved with my afl. Formula Obought = Cum(pkVal)/Cum(pkVal); should be Obought = Cum(pkVal)/Cum(pk); But cum(pkval) does not give correct value ---which I too did not understand. Regards. |
|
#18
|
|||
|
|||
|
Dear beginner_av,,
Thank you for your help. Presently kgsirasangi has help me out to solve the problem. In metastock, there is a term called IsDefined. The meaning of which is as follows:- Returns 1 if all data necessary to calculate the formula is available, 0 if not. I was stucked there only.In the formula, IsDefined is used three times. For calculating MACD/Hist average, Obought and Osold. The original formula is as follows:- Obought:=Cum(pkVal)/Cum(IsDefined(pkVal)); Osold:=Cum(trVal)/Cum(IsDefined(trVal)); In denominator, the value should be 1 or 0 depending on value available.(so far I understand) Regards and Thanks Hitesh |
|
#19
|
|||
|
|||
|
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. .................................................. ................... add this it will plot signals as above mentioned condition.... Buy= Cross (x ,s) AND x> MA(pkval,periods); Sell= Cross (x ,s) AND x<MA(trval,periods); Cover = Cross (x , MA(pkval,periods)) AND x> s ; Short = Cross( MA(trval,periods),x) AND x<s ; PlotShapes( shapeSmallCircle*Buy, colorBrightGreen); PlotShapes( shapeSmallCircle*Sell, colorYellow); PlotShapes( shapeUpArrow*Cover, colorBlue, -10 ); PlotShapes( shapeDownArrow*Short, colorRed, -10 ); Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); Cover=ExRem(Cover,Short); Short=ExRem(Short,Cover); ..................lets hope i have done it right.....waiting for your responce...............thanks |
|
#20
|
|||
|
|||
|
Thanks a lot Mr casoni , its working fine and well.
|
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: Need Help for Composite MACD
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macd | rahulg77 | MetaStock | 7 | Yesterday 01:04 AM |
| MA vs MACD | sgkalai | Technical Analysis | 9 | 7th December 2007 12:01 AM |
| 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.