- Joined
- 6 October 2011
- Posts
- 107
- Reactions
- 126
This looks wrong:
Filter1 = MA( C, 10 ) > C;
Should it be:
Filter1 = C> MA( C, 10 );
I'm not familiar with the WTT so it could be correct?
Duh! Yes that's it! Thanks again.
This looks wrong:
Filter1 = MA( C, 10 ) > C;
Should it be:
Filter1 = C> MA( C, 10 );
I'm not familiar with the WTT so it could be correct?
I am just in the throes of working through Nick Radge's Weekend Trend Trader
SetForeign( "XAO" );
Filter1 = C> MA( C, 10 );
Filter3 = Ref(MA( C, 10 ),-1)> Filter1;
RestorePriceArrays();
Filter = Filter1;
_SECTION_BEGIN("Buy_sell");
Hh = Ref(HHV(H,20),-1);
Buy = Iif(Filter,Cross(C,Hh),0);
//Trailing Stops:
// 1. Since buy, if index filter continues true, Stop loss at 70% of high, until
// 2. Index filter has become not true, change stop loss of 90% of high since buy, until
// 3. Index filter returns true, then 70% of high subject to this stop loss being above stop loss in Condition 2
Stop1 = IIf(Filter1,C<= Hh*.7,0); //stop condition1
Stop2 = IIf(Filter3, C<= Hh*.9,0); //stop condition2
Stop3 = IIf(Ref(filter3,-1), C<= Hh*.9,0); //stop condition3
Sell = C<Stop1 OR C<Stop2 OR C<Stop3;
_SECTION_END();
i just recently purchased amibroker and got a subscription to premium data. i've been playing around with it for a few days and am impressed with the product.
one thing i'm still trying to understand is how to deal with ordinary dividends. running the backtest amibroker does not seem to account for stocks paying a dividend. is there something i'm not doing right? how are others dealing with this in their backtests?
I think you want to calculate the cash value by multiplying the share holding at ex-date and the cash dividend. I.e. 10000 shares x 20 cent dividend if the stock held at ex-date. another consideration is the franking credits if held for the 45 day post ex-date. I'm sure this could be done but you would need accurate financial data and a good AFL programmer.one thing i'm still trying to understand is how to deal with ordinary dividends. running the backtest amibroker does not seem to account for stocks paying a dividend. is there something i'm not doing right? how are others dealing with this in their backtests?
Dividend = GetFnData("DividendPerShare");
DividendExDate = GetFnData("ExDividendDate");
DividendPayDate = GetFnData("DividendPayDate");
Your data supplier should offer dividend adjusted price
I have never seen a different share price than the one quoted by the stock exchange. Is there an alternative share price to the exchange quotes?premium data does not adjust the price for ordinary dividends.
I have never seen a different share price than the one quoted by the stock exchange. Is there an alternative share price to the exchange quotes?
I don't know what this means. When a stock goes ex-div, the share price usually adjusts down and this is the price the stock exchange quotes.If the prices are adjusted for ordinary dividends then I could run the backtester as is and the results would be fine.
I don't know what this means. When a stock goes ex-div, the share price usually adjusts down and this is the price the stock exchange quotes.
I know of no data supplier that does this. If you find one let me know as I am always willing to learn.Maybe an example would be more clear. CBA went ex-dividend on 17/2/15 and the dividend was $1.98. The closing price on 16/2 was $93.47 and on 17/2 it was $90.00. Now if I buy on the 16th and sell on the 17th in AmiBroker it indicates I lost $3.47 per share. To adjust for ordinary dividends (ignoring franking) on 16/2 the close price should be $93.47 - $1.98 = $91.49. If I have these prices running through the backtest then I would get a more accurate indication of my total return.
I know of no data supplier that does this. If you find one let me know as I am always willing to learn.
Okay thanks. The theoretical price is only true for the close on the 16th. so for any other buy price prior what would be the buy price? Buy Price - Dividend = Dividend Adjusted Buy Priceyahoo does this. check out the adj close column when CBA goes ex dividend. yahoo is not that reliable with dividends however.
https://au.finance.yahoo.com/q/hp?a=11&b=12&c=1980&d=03&e=8&f=2015&g=d&s=CBA.AX,+&ql=1
Correction. Dividend adjusted price is for close price back to last divvy date on 19th August 2014. This can't be true because the dividend amount would not be known that far back.Okay thanks. The theoretical price is only true for the close on the 16th.
Correction. Dividend adjusted price is for close price back to last divvy date on 19th August 2014. This can't be true because the dividend amount would not be known that far back.
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.