![]() |
|
| Discuss Experiments in Technical Analysis at the Technical Analysis within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hello friends, Thanks for your patience. Here are the four strategies and their AFL codes. ... |
|
|||||||
| Notices |
| Technical Analysis Discussion of all the principles involved in technical analysis. |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#331
|
|||
|
|||
|
Hello friends,
Thanks for your patience. Here are the four strategies and their AFL codes. I am giving some description and explanation followed by the code. Please go through the description and codes also so that any discrepancies which I might have missed may be brought out. As I was playing around the original code by modifying this parameter or that, I have re-written the Karthik's original code also in a different way. The code is same, only written in different way. This allows me to change the values easily. The four strategies are: 1. MABIUTS-K: The Karthik's original. That is why I suffix it with K. 2. MABIUTS-X: The Cross Over strategy. The X stands for Cross Over. 3. MABIUTS-M: The strategy based on Mark McRae's technique. M means McRae. 4. MABIUTS-H: The Histogram based strategy. H stands for Histogram. I will explain it in detail. 1. The Original MAIBUTS by Karthik which I named MAIBUTS-K I need not explain this as enough has been written about this already. The code which I have re-written is: ************************************************** * ("MABIUTS-K :::: Karthik's Exploration"); p1=13;p2=9; X=EMA(C,p1);Y=EMA(X,p2); Buy=X>Y AND Cross (C,Peak(C,5,1)); Sell=Cross (Y,X); Bprice=IIf(Buy,Ref(O,1),0); //Buying Price Sprice=IIf(Sell,Ref(O,1),0); //Selling Price //Note: the last character in above two lines is zero not O. Filter=Buy OR Sell; SetOption("NoDefaultColumns", True ); //The following line may be commented out if testing a single stock AddTextColumn( Name(), "Symbol", 20 , colorDefault); AddColumn(ref(DateTime(),1), "Date", formatDateTime ); AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar, colorWhite, bkcolor =IIf (Buy,colorGreen, colorRed )); AddColumn(Bprice,"Buy Price",6.2,colorGreen); AddColumn(Sprice,"Sell Price",6.2,colorRed); ************************************************** ***** 2. The MABIUTS - X Strategy: In the MABIUTS-X Code, I have simply removed the Cross(C,(Peak(C,5,1)) and changed the line to CROSS(X,Y). The code is: ********************************************** ("MABIUTS-X :::: Cross-over Exploration"); p1=13;p2=9; X=EMA(C,p1);Y=EMA(X,p2); Buy=Cross(X,Y); Sell=Cross(Y,X); Bprice=IIf(Buy,Ref(O,1),0); //Buying Price Sprice=IIf(Sell,Ref(O,1),0); //Selling Price Filter=Buy OR Sell; SetOption("NoDefaultColumns", True ); //The following line may be commented out if testing a single stock AddTextColumn( Name(), "Symbol", 20 , colorDefault); AddColumn( ref(DateTime(),1), "Date", formatDateTime ); AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar, colorWhite, bkcolor =IIf (Buy,colorGreen, colorRed )); AddColumn(Bprice,"Buy Price",6.2,colorGreen); AddColumn(Sprice,"Sell Price",6.2,colorRed); ************************************************** ************* 3. MABIUTS-M Strategy: This is based on Mark McRae's method. Here the cross-over of 5-day EMA of Close and 6-day EMA of Open are used. If the EMA(C,5) goes above EMA(O,6) it is buy and when it goes below it is Sell. I will write more about this later. The code is: ************************************************** ***** ("MABIUTS-M :::: Mark MacRae's method."); p1=5;p2=6; X=EMA(C,p1);Y=EMA(O,p2); Buy=Cross(X,Y); Sell=Cross(Y,X); Bprice=IIf(Buy,Ref(O,1),0); //Buying Price Sprice=IIf(Sell,Ref(O,1),0); //Selling Price Filter=Buy OR Sell; SetOption("NoDefaultColumns", True ); AddTextColumn( Name(), "Symbol", 20, colorDefault); AddColumn( ref(DateTime(),1), "Date", formatDateTime ); AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar, colorDefault, bkcolor =IIf (Buy,colorGreen, colorRed )); AddColumn(Bprice,"Buying Price",6.2,ColorGreen); AddColumn(Sprice,"Selling Price",6.2,ColorRed); ************************************************** ********* 4. MABIUTS-H Strategy: This is what most people are waiting for. But it needs some explanation. Not because it is complicated. The code is as simple as the others. This is a modification of the Cross Over strategy, MABIUTS-X. What I have done is look at the cross over from a different angle. Any crossover method based on Moving Averages gives the signal after a delay. This is because the Moving Averages are lagging indicators. The delay can be upto half the period of Moving Average. This can be proved. If any of you want the proof, please post a message. I will explain it. It is simple. Now let us study the cross over from my angle. When two curves cross over what happens is they start coming closer and at the cross over point they meet. Thereafter they move away. If one more cross over occurs they have to come closer again and meet. It means, between the two cross over points they initially go apart upto some distance and then come closer. Put in a different way, the difference between the two moving averages after a cross over goes on increasing, reaches a maximum and then starts decreasing till the cross over. At cross over point the difference is zero. Now, if we plot this difference as a bar graph we get a histogram similar to the MACD histogram. The tallest bar is the maximum point. So, I tried to trade with this maximum bar. When the maximum bar appears SELL and when it is minimum (NOT ZERO) SELL. It worked wonders. It was able to catch the trend change and price reversals very early compared to the Cross over. To identify the maximum and minimum bars you can plot this difference as histogram and visually see. You can explore and locate the bars by writing a code to identify the max and min. How do we do it? A maximum bar is identified by two smaller bars on either side. So among three consecutive bars, if the middle bar is the highest you have the maximum. Similarly Among three consecutive bars if the middle bar is the shortest then you have the minimum. This is what I have coded in the MAIBUTS-H. The Code is: ************************************************** ******* ("MABIUTS-H :::: Histogram Exploration"); p1=15;p2=15; X=EMA(C,p1);Y=EMA(X,p2); D=X-Y; Buy=Ref(D,-2)>Ref(D,-1) AND D>Ref(D,-1); Sell=Ref(D,-2)<Ref(D,-1) AND D<Ref(D,-1); Bprice=IIf(Buy,O,0); //Buying Price Sprice=IIf(Sell,O,0); //Selling Price Filter=Buy OR Sell; SetOption("NoDefaultColumns", True ); //The following line may be commented out if testing a single stock AddTextColumn( Name(), "Symbol", 77 , colorDefault); AddColumn( Ref(DateTime(),1), "Date", formatDateTime ); AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar, colorWhite, bkcolor =IIf (Buy,colorGreen, colorRed )); AddColumn(Bprice,"Buying Price",6.2,colorGreen); AddColumn(Sprice,"Selling Price",6.2,colorRed); ************************************************** ******** I wanted to discuss these four strategies in more detail. But I have some other urgent work. Therefore I am not giving any results today. As many of you are waiting eagerly for these codes I decided to just give them and postpone the discussion to another post. I know you have many questions but I will answer them later. But post your queries, views and comments at the earliest so that you won't forget any points. Sorry for very brief description. As I have written this in a hurry, there may be some grammatical or spelling mistakes. I did not check. Please ignore them. If there are any errors in the program, pleasae bring to my notice. Regards. -Anant Last edited by asnavale; 13th November 2006 at 07:35 PM. |
| Sponsored Links |
|
#332
|
|||
|
|||
|
Dear Ananth
I am amazed at the depth of analysis being done by you.. truly befitting a scientist. Great post by sanjay and murthy. It is sad that I am unable to fully participate in the discussion now as I am too preoccupied with my work. Though it is well past midnight and my weary eyes are clsoing automatically could not resist plotting the MABIUTS-H strategy.. Chart of MABIUTS-H and MABIUTS-K enclosed.... comments later.. it is time to crash.. to be ready for another hard day... warm regards Karthik Last edited by karthikmarar; 20th May 2008 at 12:40 AM. |
|
#333
|
|||
|
|||
|
Dear Anant
Your histogram concept is excellent. Let me congratulate you for a fresh approach on cross-overs. Just thinking about the concept, the first impression was, it should give lots of wipsaws. But the data you have presented suggests otherwise, just shows to go how deceptive perceptions are. I would do some testing of my own, before making any further comments. Just a seed of a thought for the portfolio part of the experimentation, if we could incorporate stock selection based on relative strength the overall performance of the folio can be improved, we can come back to this later... Thanks a lot, for sharing your findings and code. Regards Sanjay Last edited by SGM; 9th November 2006 at 06:33 AM. |
|
#334
|
|||
|
|||
|
Quote:
Special Thanks to you, for taking us on this path and guiding us along the way. Do take good care of your health. Warm Regards Sanjay |
|
#335
|
|||
|
|||
|
dear asnavale,
thanks for the AFL's for the different strategies adopted. based on posted results, everybody will be eager to go through the MABIUTS-H logic, and me too. a few of my responses on the write-up: Quote:
Quote:
another way of putting the crossovers is: buy= EMASHORT/EMALONG>1 sell= EMASHORT/EMALONG<1 if this is modified to: buy= EMASHORT/EMALONG>1.02 sell= EMASHORT/EMALONG<0.98 this 2% (or another such small value) 'dead--band' could possibly exclude such weak crossovers. this dead-band can be optimised. Quote:
i am aware that my comments 2 & 3 will incorporate delays and possibly may reduce the RETURNS. but they may reduce the RISK too. these may eat away part of the benefits of the removed delay by the method hinted in my first comment. these comments of mine are more hypothetical in nature and request your comments on these. if your time permits, you may substanciate / negate by back testing. not a big issue, but, if you add a column to show the date of crossover in the exploration window, it may help to know from the window itself how old is the cross-over and the most recent cross-overs. thanks asnavale for your posts with the professional aproach to trading research. all the best. murthymsr Last edited by murthymsr; 9th November 2006 at 07:18 AM. |
|
#337
|
|||
|
|||
|
Hi,
MABIUTS-H is a very innovative and novel approach. Very scientific explanation too. Please explain the proof of Moving average delay. ***Uma*** |
|
#338
|
|||
|
|||
|
Hello SGM,
It wold have been better if the price chart also was overlayed with the histogram. Just my opinion. No degrading of your effort. Regards ***Uma*** |
|
#339
|
|||
|
|||
|
Gud work !!! keep it up !!
|
|
#340
|
|||
|
|||
|
Quote:
Do you have MS code for your theory? I would love to try it out. If anyone else has the code I would be very appreciative. Thanks, TheTraderMan |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: Experiments in Technical Analysis
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Technical Analysis Course | snowy | Technical Analysis | 28 | 7th November 2008 07:37 PM |
| Technical analysis course | sh50 | Seminars & Tutors | 18 | 10th June 2007 03:46 PM |
| Hello everybody.Technical Analysis | vijay chauhan | Introductions | 2 | 30th May 2007 03:09 PM |
| Technical Analysis | crosscurrency | Forex | 0 | 30th October 2005 11:00 PM |
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.