Questions tagged [blotter]

blotter is an R package typically used with the R package quantstrat (as a dependency package for quantstrat). Blotter provides transaction-oriented infrastructure for constructing transactions, portfolios and accounts for trading systems and simulation in R. blotter is under active development at https://github.com/braverock/blotter

71 questions
1
vote
0 answers

Transmit trades between Excel and R

Is there a way to make calls between R and Excel in order to run R quantstrat package using EOD data. Send proposed trades to an excel file (which has to be inserted manually as the broker does not have an API) and then import the trades from an…
1
vote
0 answers

Blotter for pre existing portfolios, dealing with splits

Using the blotter package, I want to analyse a series of pre-existing portfolios. As discussed elsewhere on stackoverflow, Blotter uses raw prices by default, which can be altered by using adjustOHLC(). However , my main issue is dealing with the…
R.S.
  • 2,093
  • 14
  • 29
1
vote
1 answer

Warning message with blotter / quantmod /quanstrat - Incompatible methods ("Ops.POSIXt", "Ops.Date")

Sorry in advance for the long post, I'm not sure how to reduce it though. I have started using the blotter / quanstrat package from this tutorial of Guy Yollin. If I use Mr. Yollin code as it is, no worries I'm getting similar results. …
Franky
  • 721
  • 3
  • 11
  • 19
1
vote
1 answer

Tradestats trade vs transaction

Can someone explain the difference between the "number of trades" and the "number of transactions" when using library(blotter);tradeStats(portfolio_name)?According to the help docs a trade is 'flat-to-flat' by default, and a transaction is the…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
1
vote
1 answer

add custom TA to chart.Posn()

I have the same problem as: Add Technical Indicator to chart.Posn However, I am working with a custom indicator and it is plotting on top of the positions chart. can someone assist me? The indicator I am working with is proprietary, but any defined…
jonnie
  • 745
  • 1
  • 13
  • 22
1
vote
2 answers

Optimizing Quanstrat MACD with apply.paramset returns error

I am trying to test some trading strategies involving digital currency. One such strategy involves MACD crossovers, but I would like to optimize the nSlow & nFast parameters. Here's a reproducible example (which…
Ray
  • 3,137
  • 8
  • 32
  • 59
1
vote
2 answers

Quantstrat rule label in transaction

I don't seem to find is there a way to see Rule name/label of the transaction when reviewing them. I use getTxns() but it is from blotter package and it is not aware of rules that are created by quantstrat. What would be best way to do that?
nesvarbu
  • 986
  • 2
  • 9
  • 24
1
vote
1 answer

Convert from R to quantstrat setup for trading strategy backtesting

I am trying to backtest a trading strategy with "quantstrat" package. My strategy is composed by 4 indicators, 3 different EMAs and 1 lagged EMA. I want to go long when: EMA1 > EMA2 & EMA1 > EMA3 & EMA1_lag < EMA1 I want to exit and go flat when:…
1
vote
1 answer

Blotter intraday realized PL

This is a question about the realized PL of the transactions in the amzn_test demo of the blotter R package. The transactions are a sequence of 7 trades that open and close positions intraday. A call to getTxns('amzn_port', 'amzn') returns …
mgsot
  • 11
  • 2
1
vote
1 answer

Trying to understand blotter account Unrealized.PL and End.Eq calculation

While programming a strategy in blotter, I came across the problem that the End.Eq after my trades did not match my expected results from manual calculation. So I have written some simple R code to better understand how blotter works. Also here the…
JBlohm
  • 13
  • 3
1
vote
1 answer

Cant install blotter package used for quantstrat

I'm trying to use the quantstrat package in R. I have uploaded/installed the package using install.packages("quantstrat", repos="http://R-Forge.R-project.org") However the once I use require(quanstrat) I get the message : Loading required…
NMRQL
  • 65
  • 1
  • 6
1
vote
2 answers

In the R blotter package, are matured instruments removed from positions?

Suppose I have a blotter portfolio of instruments that mature at some date. Will the getPos function recognize that my position in these instruments changes after this date? In other words, is getPos smart enough to simulate instruments that…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
1
vote
1 answer

In the R blotter package, is it possible to add metadata to transactions?

In the blotter R package, you can add transactions to a portfolio using the addTxn and addTxns functions. Is it possible to attach metadata to these transactions? For example, it would be useful to be able to add an identifier to each entry.
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
1
vote
0 answers

R - Quantstrat Issue with prefer and getPrice

Currently working on a strategy in quantstrat using Quandl futures data. However, when I try to applyStrategy() after adding indicators, signals and order rules, I receive the following error message, Error in getPrice(mktdata, prefer = prefer) :…
user6893
  • 143
  • 1
  • 2
  • 9
1
vote
1 answer

Multi-currency portfolios and accounts with R Blotter and quantstrat

What is the best methodology for modelling with several currencies in the account and securities with different currency denominations in a portfolio? Is it best to keep portfolios and accounts single currency? Will blotter then handle fx when…
KDJ
  • 83
  • 1
  • 5