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
Questions tagged [blotter]
71 questions
2
votes
1 answer
Error implementing a stoplimit order in quantstrat
After adding ordertype=stoplimit rules for stoploss implementation in quantstrat's pair_trade.R demo (only the short side shown below) as,
# stop loss for short order (child)
add.rule(strategy=pairStrat, name = 'ruleSignal',…

marital_weeping
- 618
- 5
- 18
2
votes
1 answer
R - FinancialInstrument Package Changing Symbol Names when using stock
I'm currently in the process of building a strategy using quantstrat/blotter. The price data that I'm using uses numbers as the security identifiers and these numbers are therefore the column names as well as what I use for the synbol names in…

user6893
- 143
- 1
- 2
- 9
2
votes
1 answer
R: Using foreach with blotter, portfolio already exists error
I'm using the blotter package to run a backtest, and using foreach to speed things up. I'm running into an error where blotter finds the portfolio with the same name even though they are supposed to be removed at the start of the function. Here's a…

wintermelon
- 73
- 5
2
votes
1 answer
How to setup futures instruments in FinancialInstrument to lookup data from CSIdata
Background
I am trying to setup my trade analysis environment. I am running some rule based strategies on futures on different brokers and trying to aggregate trades from different brokers in one place. I am using blotter package as my main tool for…

CHP
- 16,981
- 4
- 38
- 57
1
vote
1 answer
Error when running initPortf in Blotter package for R
I am having trouble initializing portfolios with the Blotter Package in R.
I am cycling through a list of variables that I want to initialize, and when I initialize with a single symbol, it works fine.
But when I try to do it with a list of symbols,…

Kevin Muir
- 21
- 3
1
vote
0 answers
Quantstrat Multiple Symbol Strategy - Trades with chronological order rather than alphabetically when investing with full equity
A minimum reproducible example:
library(quantstrat)
startd<-"2022-08-01 01:00:00"
finishd<-"2022-08-01 02:15:00"
symbols<-c("AXSUSD", "XRPUSD")
AXSUSD<- structure(c(18.59, 18.59, 18.56, 18.51, 18.53, 18.5, 18.5, 18.5,
18.5,…

Serhat Akay
- 115
- 10
1
vote
1 answer
R quantstrat futures example - "Transactions must be added in order"
Edit: the fix was easier than thought, I just initialized the portfolio, account and orders too late, given my data starts earlier. The following makes to code run. I won't delete my question, since I found hardly any examples for individual…

tester
- 1,662
- 1
- 10
- 16
1
vote
1 answer
What step is necessary to get an output after running add.distribution and apply.paramset when optimizing in Quantstrat?
I have been following the following tutorial to learn how to test different variables in quantstrat.
https://timtrice.github.io/backtesting-strategies/parameter-optimization.html
The part of the tutorial about optimization is in part 7 of this link,…

mineralpoint
- 23
- 3
1
vote
0 answers
Unable to download 'blotter' package
I'm currently running on MacOS Sierra, 10.12.6 and I'm running Rstudio Version 1.2.5033.
I'm working on a project that requires the use of the 'quantstrat' package.
I've been trying to install 'quantstrat' package using…

Aden Neo
- 31
- 1
- 4
1
vote
0 answers
Line break \n not working in Javascript Blotter
I don't understand why the break \n doesn't work in the phrase "Explore \n more" of the Blotter code shown below. I would like the word "more" to go in a new line but nothing happens. Does anyone have a suggestion?
const blotterElems =…

user12127010
- 11
- 1
1
vote
1 answer
How can I change the blotter canvas size?
For some reason the blotter.js canvas size is not cangable. Blotter seems to generate a canvas named b-canvas by default? But I can't find where it gets it width and height from? And I am not able to set a new width and size by .style in js.…

L MXIII
- 21
- 2
1
vote
1 answer
Blotter cannot be loaded in r 3.5.1
I was able to use blotter and run quantstrat fine with previous r version
However, I have updated R vesion to 3.5.1 and when I load blotter I receive this msg when loading blotter:
"Error: package or namespace load failed for ‘blotter’: package…

Dongyang Fu
- 55
- 7
1
vote
0 answers
Returning the last date of xts object with end()
I am using blotter and related packages to create a small portfolio. These packages rely on data from yahoo. Additionally, they are using xts internally, but somehow the functions on a xts object don't work and return the desired results. This of…

hannes101
- 2,410
- 1
- 17
- 40
1
vote
1 answer
Log chart in blotter function chart.Posn() possible?
Is it possible to draw a log price chart in the chart.Posn() or chart.Reconcile() functions of blotter? I tried adding log.scale = TRUE to the function call without success. Is the underlying chart_Series function still too "experimental" to support…

sdittmar
- 365
- 2
- 14
1
vote
1 answer
End equity (and other trading stats) update issue in portfolio - blotter
I have multiple symbols in a portfolio but when running a blotter trading strategy the end equity only updates for the last symbol that has been run. When looking into how the equity updates each transaction it seems that when a new symbol is…

actuaryintraining
- 21
- 4