Hi OpenTrades,
Sorry for late response. Thank you for guiding. Inside addTxn code, I saw
that it looks for function that matches the string value of argument
TxnFees of the add.rule function. I see that it assumes the function takes
in only 2 arguments and no "...". My question is that is there anyway to
pass more than the assumed arguments? Or I have to define other parameters
to my cost as global parameters so that I can see it in my customized cost
function? Thank you again.
Robert
On Wed, Dec 19, 2012 at 6:32 AM, OpenTrades wrote:
> 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 fees.
>
> Just type "addTxn" 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@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@opentrades.nl
> Twitter: @opentrades
>
> ______________________________**_________________
> R-SIG-Finance@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.
>
[[alternative HTML version deleted]]