Description Usage Arguments Value Author(s) Examples

View source: R/util_profit_factor.R

Calculate profit factor using a data vector with the trading results

1 |

`x` |
column vector with profit or loss of the orders for one system |

function should calculate profit factor for this vector and return one value also as vector

(C) 2019 Vladimir Zhbanko

1 2 3 4 5 6 7 8 9 10 | ```
library(magrittr)
library(dplyr)
library(lazytrade)
data(profit_factor_data)
profit_factor_data %>%
group_by(X1) %>%
summarise(PnL = sum(X5),
NumTrades = n(),
PrFact = util_profit_factor(X5)) %>%
select(PrFact) %>% head(1) %>% round(3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.