简体   繁体   English

tradeStrats() 中 use = “txns” 和 use = “trades” 的区别?

[英]Difference between use = “txns” and use = “trades” in tradeStrats()?

I'm backtesting a trading strategy using the quantstrat package, when generating trade statistics using the tradeStats() function, what does de use = argument changes if using "txns" instead of "trades" as the argument.我正在使用quantstrat package 对交易策略进行回测,当使用tradeStats() function 生成交易统计数据时,如果使用"txns"而不是"trades"作为参数,de use =参数会发生什么变化。

The tradeStats function is in blotter...you can read the source here -https://github.com/braverock/blotter/blob/master/R/tradeStats.R . tradeStats function 在吸墨纸中……您可以在此处阅读源代码 -https://github.com/braverock/blotter/blob/master/R/tradeStats.ZE1E1D3D40573127E9ZEE048 When using "txns" the PnL is derived from the portfolio object, which typically is marked daily to the close price.当使用"txns"时,盈亏来自投资组合 object,通常以每日收盘价标记。 When using "trades" the PnL will be based on the round trip trade (at least one buy txn and one sell txn, for example) which could be longer or shorter than the period used in the txn PL calculation.当使用"trades"时,盈亏将基于往返交易(例如,至少一笔买入 txn 和一笔卖出 txn),这可能比 txn 盈亏计算中使用的周期更长或更短。 For intraday and other high frequency strategies you probably want to use "trades" and for lower frequency strategies that trade over periods typically spanning more than 1 day you probably want to use "txns" so that you get the analysis based on a daily mark-to-market of your portfolio.对于日内和其他高频策略,您可能想要使用"trades" ,而对于交易周期通常超过 1 天的低频策略,您可能想要使用"txns" ,以便您获得基于每日标记的分析-将您的投资组合推向市场。 HTH. HTH。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用dplyr计算一组行与目标行之间的差异? - How to use dplyr to calculate difference between a set of rows and a target row? 使用 tidyverse 查找基本模型运行与所有其他模型之间的差异 - Use tidyverse to find difference between base model run and all others 计算连续数之间的差异,并用于输出到R中的另一个数据帧 - calculate difference between successive number and use to output to another dataframe in R 如何使用dplyr :: nest计算出两个数据集之间的差异 - How to use dplyr::nest to work out the difference between two data sets 在 R 中,使用 dplyr::across 并计算 2 列之间的差异,用于多列前缀 - In R, use dplyr::across and compute difference between 2 columns, for multiple column prefixes 这两个类有什么区别,为什么我必须在我的代码中使用 as_tibble function? - what's the difference between these two classes and why I must use as_tibble function in my code? 如何使用mutate在我的数据框的一列中找到两年之间的差异? - How can I use mutate to find the difference between two years in one column of my dataframe? 使用 geom_ribbon (ggplot2) 绘制颜色变化的两个时间序列之间的差异 - Use geom_ribbon (ggplot2) to plot difference between two time series with changing colors 使用dplyr计算滞后差异 - Use dplyr to compute lagging difference 使用任何套用方法找出每个学生的最高和最低分数之间的差异 - Use any apply method to find difference between max and min score for each students
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM