![]() |
|
| Discuss Experiments in Technical Analysis at the Technical Analysis within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Jorgen T, Exact replica of Peak function is not available in public domain,however many use ... |
|
|||||||
| Notices |
| Technical Analysis Discussion of all the principles involved in technical analysis. |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#841
|
|||
|
|||
|
Jorgen T,
Exact replica of Peak function is not available in public domain,however many use HHV function instead. Asish |
| Sponsored Links |
|
#842
|
|||
|
|||
|
Quote:
It seems working nice. I would like to back test it using amibroker but when i scanned, it shows all trades of EMA cross. If i try for back test with shorts and longs it gives error message "Missing short/cover variable assingnment". I would like to test only for the trades of EMA cross overs, with MACD as u have given in AFL. I am new to backtesting can u guide me with settings to be made in backtester. I am testing with Nifty charts. Can u add the display of rates in the chart whenever buy / sell arrow is triggered. Raj |
|
#843
|
|||
|
|||
|
Quote:
The AFL I had attached was for using as an indicator. For Exploring and backtesting you have to change it slightly. I don't know whether you have made the necessary changes. I am attaching the AFL required for Exploring/backtesting with this message. Try this AFL and give your feedback. This AFL has only Buy and Sell codes. There are no separate Short/Cover codes. Short is same as Sell and Cover is same as Buy. Note that the attached file has .txt extension which should be changed to .afl before using in AmiBroker. To use the AFL to include MACD also, set the MACD selection switch appropriately in Exploration window parameters before running Exploration/Back testing. It is possible to add The price to the charts but it works only in AmiBroker version 4.8 and higher. Therefore I did not add the code so that users with lower versions can also use it. I can give you the additional code also but please let me know which price you want to display? Is it Open or Close or any other? Regards -Anant Last edited by asnavale; 29th March 2007 at 09:27 PM. |
|
#844
|
|||
|
|||
|
It is great idea specially for we jun'r members
i will b g8ful. |
|
#845
|
|||
|
|||
|
Quote:
Yes it is true that Mabiuts K1 works well in a trending market . The idea behind this system was keep one away in a ranging market. I will explain a bit. The value “y” in the afl is a adaptive EMA. Based on the ADX or RAVI value the EMA factor is adjusted. Below a certain value of the ADX (which indicates a non trending market) the factor is pegged to a constant so that the EMA becomes a straight line. The BUY condition is when the “y” is greater that a signal line which is an EMA (6) of the “y” itself. In a ranging market “y” becomes a straight line and the EMA of “y” along becomes a straight line. So there will be no buy condition. You can try to change the BUY condition to get better result.. for example ROC(y) > x. Next let us see the purpose of the peak function. This function tries to ensure that the stock is making a higher high, which is the basic definition of Trend. May be we should check if the stock has already made a higher low. May be this will improve the system a bit. I did some analysis of your test result. First I really appreciate the big effort. It was must have consumed quite a bit of your time. Looking at results the percentage of green signals is quite high compared to the orange signals. Most orange signals went down later. I wonder what happened to the green ones. Did they go up? If they did then the success rate of the system is quite OK. Of course we cannot have a 100% success rate. Fortunately the red signals are minimal. Overall the system seems to be OK and should given good results with proper MM. A combination of EMA and ADX could be used to establish the trend. Even better the slope of the EMA line with ADX.. what do you think? Warm regards Karthik |
|
#846
|
|||
|
|||
|
This is for Ami ,as he posted .
Asish Last edited by uasish; 4th June 2008 at 09:13 AM. |
|
#848
|
|||
|
|||
|
Sorry,age is cathing up.
Asish |
|
#849
|
|||
|
|||
|
CONTINUING WITH MACD Hello friends, In my earlier post had promised to post the Zero Lag MACD. I had prepared the write-up a few days back. Generally, I show my important write-ups to my friends for their comments before posting. When I showed the Zero Lag MACD write-up to them, they were of the opinion that I should first go into the details of MA lag and methods of removing the lag so that it helps in understanding the Zero Lag MACD. Therefore, I had to revise the write-up and there was delay. Now I am going into the details of MA lag. MACD is made of two moving averages - one long period Exponential Moving Average and one short period Exponential Moving Average (EMA). The signal line is also a Moving Average. Although there are three EMAs we actually plot two of them, The difference of Short and Long EMAs as MACD line and the EMA as SIGNAL line. As MACD is based on Moving Averages, the advantages and disadvantages of Moving averages are also reflected in MACD. Therefore it is advantageous to study the properties of Moving Averages a little deeper. Any trader learning Technical Analysis (TA) is first introduced to Moving Averages. Moving averages can be considered as the foundation of Technical Analysis. Two important characteristics of Moving averages are:
Therefore, although the MAs are simple to calculate and interpret, their application is always a trade off between the above two characteristics. If we try to smooth the data more, the lag is also more and vice versa. Smoothening the data means reducing the high variations or filtering the noise. (Those who are familiar with Electrical/Electronics Engineering can consider this as a low pass filter). The Moving Average Lag is most important characteristic which affects the traders. To reduce/remove this lag we should understand how the lag is introduced. I am explaining this with the help of attached Example-7. In this figure the black dots represent closing price of an Imaginary Stock. For the sake of simplifying the explanation we assume that the data is uniformly increasing or decreasing. That means the difference between two consecutive points is equal throughout. To calculate Simple Moving Average (SMA) for a given period 'p' at any given point we add the current value and all the PREVIOUS (p-1) values and divide the sum by 'p' and put the resulting average value under the current point (The gray colored points in Example-7). We do it for each point in the data set and join the resulting average points to get the Moving Average line. Now look at this process in a different way with the help of the Example-7. Draw a rectangle on the graph such that the current point is on the right end of the rectangle and the previous (p-1)th point is on the left end. The width of rectangle is the period 'p' of averaging. To calculate MA for each day we go on shifting this rectangle to the right one point (or price bar) at a time. As the points are equally spaced the Average of the points included in the rectangle will be at the center of the rectangle. But we plot this average under the current point. That means we shift it horizontally from the center to the right edge of the rectangle without changing the vertical position. Therefore the shift is equal to half of the width. This shifting is nothing but the Lag of the MA. In other words the Lag is equal to half of the averaging period. There are two ways to reduce this lag. The first is to produce an equal lag in opposite direction and add to the present lag. Opposite lag can be produced by taking the MA from right to left. That is start calculating the MA starting from latest bar and go towards previous bars. For example, to calculate today's 10-day MA, we add today's price and the prices of next 9 days. This needs future bars which are not available. So this method does not work. Another way is as follows. Produce another MA with a lag double that of the present lag. So, If we have MA which gives a lag of 'L' days, we take MA which produces a lag of '2L' days. As lag is half of averaging period, the second MA has a period double that of first MA. This is shown in attached Example-8. Now take difference of the two MAs and add the difference to the shorter period MA. The result is Zero Lag MA. Code:
Short period MA gives Lag = L Long period MA gives Lag = 2L Difference in the Lags = L - 2L = (-L) Add this to first Lag = L + (-L) = L - L Total Lag = L - L = 0 For EMA also the same strategy can be adopted to produce Zero Lag EMA (ZLEMA). In the next post I will deal with the construction of Zero Lag MACD. Regards -Anant |
|
#850
|
|||
|
|||
|
Quote:
Thanks for ur reply, I downloaded the file and tried backtesting it, but again i found a blank report. I have attached the report here, please guide me where i am wrong. Raj |
| 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.