Questions tagged [quantstrat]

quantstrat is a quantitative strategy framework for R

quantstrat (an R package) provides a generic infrastructure to model and backtest signal-based quantitative trading strategies. It is a high-level abstraction layer (built on the R packages xts, FinancialInstrument, blotter, etc.) that allows you to build and test strategies in very few lines of code. quantstrat is still under development but is used on real portfolios.

The latest codebase for quantstrat and blotter is at:

https://github.com/braverock/quantstrat

https://github.com/braverock/blotter

274 questions
-3
votes
1 answer

I am trying to develop a strategy in squanstrat that buys the QQQ when the 200 SMA is greater than the stock and sells when it is the opposite

I am trying to develop a strategy in quanstrat that buys when the QQQ is greater than the SMA 200 and sells when the SMA 200 is less than the QQQ. But there is a propblem with my buy and sell signals . This is the error Error in…
user11344107
-3
votes
2 answers

Comparing the High and Low from one day to the previous

I am trying to make and indicator to use in my quantstrat backtest but can't seem to figure out how to write it. Basically I want to compare the High and Low from 2 days ago to the H&L from 3 days ago. If day 2's H&L is lower than day 3 I'll make…
Cameron Giles
  • 72
  • 1
  • 8
-3
votes
1 answer

checking if value is greater or less then specified value

I am trying to tell whether a specific column value is greater than .77, but this code returns 1 if the value is greater then 0. Is there any way to use a known function (not a custom one) to do a simple greater then check?…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
-5
votes
1 answer

Query in back-testing strategy in R- Indian trader perspective

There is a documentation for backtesting in R in GitHub(https://timtrice.github.io/backtesting-strategies/). I have a query in two lines of code mentioned in this document…
Praveen Kumar-M
  • 223
  • 2
  • 10
1 2 3
18
19