[R-SIG-Finance] quantstrat parameter prefer = 'Open" question
Andre Mikulec
andre_mikulec at hotmail.com
Mon Jan 29 20:58:53 CET 2018
Here "prefer = 'Open' is shown
https://github.com/braverock/quantstrat/blob/b32907739c1aca80cb9a49de79a980e1b9922bc5/demo/rocema.R
# * using prefer='Open' on next bar
applyStrategy(s, p, parameters=list(nEMA=.ema,nROC=.roc,nTREND=.trend), verbose = FALSE, prefer='Open')
Here "prefer = High/Low" are shown
https://timtrice.github.io/backtesting-strategies/stop-loss.html#add-rules-1
add.rule(. . ., prefer = "High", . . .)
Thanks,
Andre Mikulec
Andre_Mikulec at Hotmail.com
________________________________
From: Ilya Kipnis <ilya.kipnis at gmail.com>
Sent: Monday, January 29, 2018 2:45 PM
To: Andre Mikulec
Cc: r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] quantstrat parameter prefer = 'Open" question
They go in your rules, not in the applyStrategy call, to my knowledge.
On Mon, Jan 29, 2018 at 2:30 PM, Andre Mikulec <andre_mikulec at hotmail.com<mailto:andre_mikulec at hotmail.com>> wrote:
Hello,
I am using quantstrat.
I have noticed that the prefer argument is acceptable to be sent in many functions.
I would like make a 'decision to buy' based on yesterday's Closing price.
I would like to *actually buy* this morning at today's Opening price.
In https://github.com/braverock/quantstrat
based on what I have seen, and debugged/traced through
in the demos and sandbox directories' *.R files
the case seems that ( in for example demo/faber.R )
1.
I *would not* send the parameter "prefer = 'Open'"
to add.rule.
So my add.rule would look like add.rule(. . . sigCrossover . . .)
2.
I *would* send the parameter "prefer = 'Open'"
to applyStrategy
So my applyStrategy would look like applyStrategy(. . . , prefer = 'Open', . . .)
Are 1. and 2. true?
If not true, what would I need to do?
What function calls with "prefer = 'Open'" would be needed?
Thanks,
Andre Mikulec
Andre_Mikulec at Hotmail.com
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Finance at r-project.org<mailto:R-SIG-Finance at r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list