SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: How can I specify the instrument to be used to enter or exit the position [ Reply ]
By: Brian Peterson on 2016-03-22 11:18
[forum:43071]
There are three multiple ways to accomplish what you want. in the case of the example you show here, you could use a rebalancing rule, since the strategy you are looking at is more a filter/portfolio strategy than a signal driven strategy. You could also structure your signal process to be instrument dependent. The simplest way to do that would be to use sigFormula and include the current symbol. You could also use a custom rule other than ruleSignal, or a custom order sizing function that is instrument aware to react to generic signals.

If I were doing this, for this strategy, I would probably use sigFormula.

Indicators: (using sigComparison)
VTI > VEA
VTI > TLT
VEA > TLT

and then sigFormula to generate buy/sell signals for each instrument



RE: How can I specify the instrument to be used to enter or exit the position [ Reply ]
By: Khan Bax on 2016-03-22 10:38
[forum:43070]
To use a specific instrument to enter or exit, you need to use a different strategy name per instrument. Add an appropriate enter or exit time column in the indicator matrix.

Use the following code to apply indicators, signals and rules per instrument.
VIX.indicator = applyIndicators(qs.strategy1, mktdata = OHLC(VIX),
parameters = list(symbol = "VIX"))
VIX.signal = applySignals(qs.strategy1, mktdata = VIX.indicator)

applyRules(portfolio = multi.instruments,strategy = qs.strategy1, symbol="VIX", mktdata = VIX.signal)

Hope this helps.

How can I specify the instrument to be used to enter or exit the position [ Reply ]
By: Alex on 2016-03-20 19:00
[forum:43069]
Hello. I'm new to quantstrat. I would like to test this strategy using quantstrat. But I have one question. How can I specify the instrument to be used to enter or exit the position? As I understand add.rule does not support specify instrument

strategy http://seekingalpha.com/article/2649915-dual-momentum-how-to-implement-strategy-for-higher-returns-with-lower-risk

Thanks to:
Vienna University of Economics and Business Powered By FusionForge