[R-SIG-Finance] how to use all the cumulative equities in the account to buy

Gambulator Gambulator gambulator at gmail.com
Wed Aug 5 03:26:28 CEST 2015


Say I am trading SPY and started with 100k. I would like to have my first
trade to buy whatever number of shares SPY I can buy. Then let's say I made
money and my account now has 200k, I want my next trade to use 200k and buy
whatever SPY I can buy and if I lose money then I would use whatever the
leftover is to do the next trade.

I see people talking about using the rebalance function to do that and then
I see people mentioning percentRisk function but I can't quite figure out
how to call these functions properly. Perhaps they are for portfolio with
more than 1 stock and requires asset allocation type of rebalancing.

Is there an out of the box function that would buy using my current equity
? If not, anyone has a custom one that I can use ? After doing some
googling, some people suggest that we can just add the P&L to the initial
capital and figure out the current equity. Is that the way to go ?

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list