[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] arrows on price chart



PureBytes Links

Trading Reference Links

Chuck,

You are absolutely right. Adding a fixed 1 cent/share
commission rate will not work with backadjusted data. 

In fact, adding any fixed per share amount will have this
problem no matter where one does it. One could do it as my
code does by adjusting the buy and sell prices, or by using
the 4th option in Settings/General/Commission&rates or with
the new SetOption method. In every case it would result in
unrealistic results. That might explain why my test results
from 1993-1997 are considerably worse than from
1998-present.

I like your suggestion of using the the ratio of actual
price to adjusted price, but with a bit of a variation

What do you think of the following code?

RawFee = 0.01; //InterActive charge for up to 500 shares
ActualClose = OpenInterest/100;// from Yahoo or CSI
AdjustedRatio = Close/ActualClose;
AdjFee = RawFee * AdjustedRatio;

SetTradeDelays(1,1,1,1);
SetOption("PriceBoundChecking",False);//must be off
slippage   = 0.005;// 0.005 is 1/2%
Commission = AdjFee;//
BuyPrice = CoverPrice = (Open*(1+slippage)) + AdjFee;
SellPrice = ShortPrice = (Open*(1-slippage)) - AdjFee;

--- Chuck Rademacher <chuck_rademacher@xxxxxxxxxx> wrote:
> b,
> 
> Knowing what I know about your data, I believe that your
> commission
> calculation is fraught with problems.
> 
> Take a stock that has been backadjusted such that it is
> (say) ten cents
> instead of the actual price of (say) $30.   Also, let's
> say that you are
> going to invest $10,000 in that stock.  AB will buy a
> zillion shares, with a
> commission of one cent per share, instead of a few
> hundred shares with a
> commission of one cent per share.
> 
> So... how do we get more accurate slippage figures.   I
> believe that we have
> to do one of the following:
> 
> a.  Simply use a flat percentage (say 1/2 percent) or
> 
> b.  Use an adjustable percentage that considers the
> actual price in its
> calculation (say 1/2% if the actual price is > $5, else
> 1%).
> 
> 
> You probably could calculate a "cents per share"
> commission, but you would
> have to consider the ratio of backadjusted to actual
> prices in such a
> calculation.  You might end up with 10 cents per share or
> 1/1000th of a cent
> per share or anything in between.
>   -----Original Message-----
>   From: b [mailto:b519b@xxxxxxxxx]
>   Sent: Wednesday, February 25, 2004 8:17 PM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: RE: [amibroker] CommissionMode option (4.51
> new feature)
> 
> 
>   I have my commission on the settings page set to zero
> and I
>   handle commissions and slippage directly in my AFL
> code.
>   The following example shows how to build percentage
> (the
>   slippage part) and fixed per share amounts into the
> price
>   array.
> 
>   SetTradeDelays(1,1,1,1);
>   SetOption("PriceBoundChecking",False);//must turn it
> off
>   slippage       = 0.005;// 0.005 is 1/2%
>   Commission       = 0.01;// 0.01 is 1 cent/share
>   BuyPrice = CoverPrice = (Open*(1+slippage)) +
> Commission;
>   SellPrice = ShortPrice = (Open*(1-slippage)) -
> Commission;
> 
>   b
> 
>   --- Thomas Chan <tchan@xxxxxxxxxx> wrote:
>   > My tests show that setOption() and the setting in the
> GUI
>   > interfere each
>   > other. Change any of the settings and the result
> changes.
>   > I ended up
>   > disabling the setOption() for now. I tried 'percent
> of
>   > trade' only.
>   >
>   >
>   >
>   >
>   >
>   >
>   >
>   > Thomas
>   >
>   >
>   >
>   > ________________________________
>   >
>   > From: Chuck Rademacher
>   > [mailto:chuck_rademacher@xxxxxxxxxx]
>   > Sent: Tuesday, February 24, 2004 10:18 PM
>   > To: amibroker@xxxxxxxxxxxxxxx
>   > Subject: [amibroker] CommissionMode option (4.51 new
>   > feature)
>   >
>   >
>   >
>   > Has anyone tried to use this new feature?   I can't
> get
>   > it to have any
>   > effect on my systems.  It doesn't override the GUI
>   > settings for
>   > commission.  I've tried all four modes.
>   >
>   >
> 
> 
>   __________________________________
>   Do you Yahoo!?
>   Get better spam protection with Yahoo! Mail.
>   http://antispam.yahoo.com/tools
> 
> 
>   Send BUG REPORTS to bugs@xxxxxxxxxxxxx
>   Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to:
> amiquote@xxxxxxxxxxxxxxx
>   (Web page:
> http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
>
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
> 
>
----------------------------------------------------------------------------
> --
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
> 
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>     c.. Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
> 
> 
> 


__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/