calculate unclosed holdings' dynamic profit. require setting unclosed=TRUE in HFTsimulator. total_profit = holdings_profit + closed_profit
character, instrument identifier.
character, "long" or "short", specifying holdings's side.
long holdings' dynamic profit = holdings * (last_price - mean_open_price), short holdings' dynamic profit = holdings * (mean_open_price - lastprice).
numeric, holdings profit.
HFTsimulator meanopen closedprofit
1 2 3 4 5
## Not run: ## get longholding's profit of TF1603 holdingsprofit("TF1603","long") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.