Description Usage Arguments Details Value Author(s) See Also Examples
Functions to help analyse trades (as opposed to profitandloss series)
1 2 3 4 5 6 7 8 9  scale_trades(amount, price, timestamp, aggregate = FALSE,
fun = NULL, ...)
split_trades(amount, price, timestamp, aggregate = FALSE)
limit(amount, price, timestamp, lim, tol = 1e8)
scale_to_unity(amount)
close_on_first(amount)
tw_exposure(amount, timestamp, start, end, abs.value = TRUE)

amount 
notionals 
price 
a vector of prices 
timestamp 
a vector. 
aggregate 

fun 
a function 
lim 
a maximum absolute position size 
start 
optional time 
end 
optional time 
abs.value 
logical. If 
... 
passed on to fun 
tol 
numeric 
scale_trades
takes a vector of notionals, prices and scales all
trades along the paths so that the maximum exposure is 1.
The default fun
divides every element of a vector n
by
max(abs(cumsum(n)))
. If userspecified, the function fun
needs to take a vector of notionals (changes in position.)
split_trades
decomposes a trade list into single trades, where a
single trade comprises those trades from a zero position to the next
zero position.
Either a list or a listoflists.
Enrico Schumann
1 2 3 4 5 6 7 8 9  n < c(1,1,3,1,2)
p < 100 + 1:length(n)
timestamp < 1:length(n)
split_trades(n, p, timestamp)
split_trades(n, p, timestamp, TRUE) ## almost like the original series
scale_trades(n, p, timestamp)
scale_trades(n, p, timestamp, TRUE) ## each _trade_ gets scaled

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.