[R-SIG-Finance] Adding transaction fee in bps (in quantstrat add.rule)

OpenTrades jan at opentrades.nl
Wed Dec 19 12:32:07 CET 2012

Check the sources for addTxn() in blotter; you will see that if TxnFees 
is a function instead of a number, it will be used to calculate the txn 

Just type "addTxn<enter>" in your console to see the source for addTxn, 
and see ?addTxn for documentation.

On 19-12-12 04:35, Robert A'gata wrote:
> Hi,
> I see many examples illustrating how to add transaction fees as a fixed
> cost (per unit). I am wondering if there is any example of how to write
> customized cost function? I don't see any to my best knowledge besides
> pennyPerStock.
> I would like to describe cost in bps for example. In my mktdata, I always
> have current price. Therefore, my cost is (bps/10000) * price * quantity.
> Any simple example would be appreciated. Then I can go wild myself. Thank
> you.
> Robert
> 	[[alternative HTML version deleted]]
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.

Jan Humme - OpenTrades

WWW:     http://www.opentrades.nl
Email:   jan at opentrades.nl
Twitter: @opentrades

More information about the R-SIG-Finance mailing list