An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110618/a82b16d6/attachment.pl>
New to R and Finance, backtest etc.
10 messages · G See, julien cuisinier, Alex Grund +5 more
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110618/4fb1a1ba/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110619/0551b5d6/attachment.pl>
Hi Julien,
thank you for the link to Brian Peterson's work. I played around with
the code, but some things do not work correctly.
Maybe you know, how to fix them:
The main problem is caused by this line:
` out <- try(applyStrategy(strategy='s' , portfolios='faber'))
which, obviously, is the most important line :-) The error message I get is:
` Error in if (length(j) == 0 || (length(j) == 1 && j == 0)) { :
` Fehlender Wert, wo TRUE/FALSE n?tig ist (translates to: "Missing
value, where TRUE/FALSE is required")
Since I did not modify the code from the PDF I think this may be a bug
in the software or a missing line of code in the PDF.
However, help is really appreciated!
"tradeStats('faber')" of course, returns NULL.
"chart.Posn('faber')" gives this error:
` Fehler in .Internal(get(x, envir, mode, inherits)) : 'x' fehlt
(translates to: error in ~: 'x' missing)
However, I have a veriable called x in my workspace, which is
displayed with "ls()", and it's non-empty:
` > x[1]
` XLU.Open XLU.High XLU.Low XLU.Close XLU.Volume XLU.Adjusted
` 1998-12-31 30.25 30.83 29.64 30.23 162900 20.12
Thank you very much!
Alex.
2011/6/19 julien cuisinier <J_Cuisinier at hotmail.com>:
Hi Alex, www.rinfinance.com/agenda/2011/BrianPeterson.pdf
reference main packages you will ever need I think... & as mentioned in previous feedback quantmod is excellent & think quantstrat better (i,e, more widely used) than the "backtest" package that I personally do not know and in general RFinance conference papers, could be good to throw a glance at them...
very well done (in my humble opinion) website for intro into R, its main data type etc..
HTH, Julien On Jun 18, 2011, at 5:16 PM, Alex Grund wrote: Hi there, I am new to R and want to perform a few experiments with trading strategies with R. However, I have experience in programming, but not in R (it's very similar to what a programmer would expect). For now, I've parsed some data (Open, High, Low, Close) of a security via read.table, which works fine. What I want to do now, is to perform a backtest of a simple trading strategy with R. Say, for example "buy on cross of MA(200) and MA(100)". Of course I could write the backtest routine by myself, but I saw a package called backtest. However, I do not really get the point how this may work. How could I use backtest package to analyse a simple strategy as above? Additionally, I would like to know, if there are some websites, wikis etc. which give a basic introduction to R in Finance "for dummies"? Anything I've seen so far was more or less for professionals. Thank you in advance Alex [[alternative HTML version deleted]]
_______________________________________________ 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.
The slide code should work, but the full Faber demo is available with
either
demo('faber')
or you can find the file in the demos directory or here:
https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/quantstrat/demo/faber.R?root=blotter
If you have problems with the demo code, we'll try to sort it out.
Regards,
- Brian
On Sun, 2011-06-19 at 13:40 +0200, Alex Grund wrote:
Hi Julien,
thank you for the link to Brian Peterson's work. I played around with
the code, but some things do not work correctly.
Maybe you know, how to fix them:
The main problem is caused by this line:
` out <- try(applyStrategy(strategy='s' , portfolios='faber'))
which, obviously, is the most important line :-) The error message I get is:
` Error in if (length(j) == 0 || (length(j) == 1 && j == 0)) { :
` Fehlender Wert, wo TRUE/FALSE n?tig ist (translates to: "Missing
value, where TRUE/FALSE is required")
Since I did not modify the code from the PDF I think this may be a bug
in the software or a missing line of code in the PDF.
However, help is really appreciated!
"tradeStats('faber')" of course, returns NULL.
"chart.Posn('faber')" gives this error:
` Fehler in .Internal(get(x, envir, mode, inherits)) : 'x' fehlt
(translates to: error in ~: 'x' missing)
However, I have a veriable called x in my workspace, which is
displayed with "ls()", and it's non-empty:
` > x[1]
` XLU.Open XLU.High XLU.Low XLU.Close XLU.Volume XLU.Adjusted
` 1998-12-31 30.25 30.83 29.64 30.23 162900 20.12
Thank you very much!
Alex.
2011/6/19 julien cuisinier <J_Cuisinier at hotmail.com>:
Hi Alex, www.rinfinance.com/agenda/2011/BrianPeterson.pdf
reference main packages you will ever need I think... & as mentioned in previous feedback quantmod is excellent & think quantstrat better (i,e, more widely used) than the "backtest" package that I personally do not know and in general RFinance conference papers, could be good to throw a glance at them...
very well done (in my humble opinion) website for intro into R, its main data type etc..
HTH, Julien On Jun 18, 2011, at 5:16 PM, Alex Grund wrote: Hi there, I am new to R and want to perform a few experiments with trading strategies with R. However, I have experience in programming, but not in R (it's very similar to what a programmer would expect). For now, I've parsed some data (Open, High, Low, Close) of a security via read.table, which works fine. What I want to do now, is to perform a backtest of a simple trading strategy with R. Say, for example "buy on cross of MA(200) and MA(100)". Of course I could write the backtest routine by myself, but I saw a package called backtest. However, I do not really get the point how this may work. How could I use backtest package to analyse a simple strategy as above? Additionally, I would like to know, if there are some websites, wikis etc. which give a basic introduction to R in Finance "for dummies"? Anything I've seen so far was more or less for professionals. Thank you in advance Alex [[alternative HTML version deleted]]
_______________________________________________ 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.
_______________________________________________ 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.
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock
Alex once you have developed a strategy in 'quantstrat' and if you feel adventurous and want to use it for live trading, I can (shamelessly) recommend that you have a look at my 'qsiblive' download here. http://censix.com It may be of interest. regards Soren
Hi there, I am new to R and want to perform a few experiments with trading strategies with R. However, I have experience in programming, but not in R (it's very similar to what a programmer would expect). For now, I've parsed some data (Open, High, Low, Close) of a security via read.table, which works fine. What I want to do now, is to perform a backtest of a simple trading strategy with R. Say, for example "buy on cross of MA(200) and MA(100)". Of course I could write the backtest routine by myself, but I saw a package called backtest. However, I do not really get the point how this may work. How could I use backtest package to analyse a simple strategy as above? Additionally, I would like to know, if there are some websites, wikis etc. which give a basic introduction to R in Finance "for dummies"? Anything I've seen so far was more or less for professionals. Thank you in advance Alex [[alternative HTML version deleted]]
_______________________________________________ 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.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110619/b7c4a7ca/attachment.pl>
A few years back (!) I was testing the then current implementation of IBrokers for throughput. At the time on a laptop I could see 10k+ messages a second in R max throughput. Within the context of IB, that is more than sufficient to handle the incoming data (given symbol limits and IB's snapshot data approach (300ms or so aggregations on 'mkt data'). This would push a single core to a pretty high cpu utilization, but easy enough to share data between procs with R. The 'testing' would really depend on you are doing in terms of trade logic. All in all though, aside from real high freq stuff, you can easily have R running logic and trades - at least if you can temper the incoming data to something like IB provides. In terms of 'yes or no' ... I think the best you can get is 'sometimes' (or 'most times' if you aren't looking at the order book or full market) Jeff On Sun, Jun 19, 2011 at 8:44 AM, Ulrich Staudinger
<ustaudinger at gmail.com> wrote:
Hey guys, has anyone ever checked runtime statistics, in the sense of processing speed, etc. of R in live trading? Obviously, it is possible to also implement C equations, but I am wondering if R etc are used in real intraday trading and about the performance characteristics observed. Thanks Ulrich On Sun, Jun 19, 2011 at 3:08 PM, <me at censix.com> wrote:
Alex once you have developed a strategy in 'quantstrat' and if you feel adventurous and want to use it for live trading, I can (shamelessly) recommend that you have a look at my 'qsiblive' download here. http://censix.com It may be of interest. regards Soren
Hi there, I am new to R and want to perform a few experiments with trading strategies with R. However, I have experience in programming, but not in R (it's very
similar
to what a programmer would expect). For now, I've parsed some data (Open, High, Low, Close) of a security via read.table, which works fine. What I want to do now, is to perform a backtest of a simple trading strategy with R. Say, for example "buy on cross of MA(200) and MA(100)". Of course I could write the backtest routine by myself, but I saw a package called backtest. However, I do not really get the point how this may work. How could I use backtest package to analyse a simple strategy as above? Additionally, I would like to know, if there are some websites, wikis
etc.
which give a basic introduction to R in Finance "for dummies"? Anything I've seen so far was more or less for professionals. Thank you in advance Alex ? ? ? [[alternative HTML version deleted]]
_______________________________________________ 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.
_______________________________________________ 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.
-- Ulrich Staudinger http://www.activequant.org Connect online: https://www.xing.com/profile/Ulrich_Staudinger ? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ 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.
Jeffrey Ryan jeffrey.ryan at lemnica.com www.lemnica.com www.esotericR.com
1 day later
Hi well, I am currently testing an intraday version of the 'qsiblive' function collection. For now everything above the 30sec bars seems to be working fine (looking at realTimeBars only). One has to be mindful of indicator and signal calculations though. If these slow things down to much, using longer bars may be the only option, aside from optimizing the indicator/signal processing (which certainly needs to be done at some point in the future) Soren
Hey guys, has anyone ever checked runtime statistics, in the sense of processing speed, etc. of R in live trading? Obviously, it is possible to also implement C equations, but I am wondering if R etc are used in real intraday trading and about the performance characteristics observed. Thanks Ulrich On Sun, Jun 19, 2011 at 3:08 PM, <me at censix.com> wrote:
Alex once you have developed a strategy in 'quantstrat' and if you feel adventurous and want to use it for live trading, I can (shamelessly) recommend that you have a look at my 'qsiblive' download here. http://censix.com It may be of interest. regards Soren
Hi there, I am new to R and want to perform a few experiments with trading strategies with R. However, I have experience in programming, but not in R (it's very
similar
to what a programmer would expect). For now, I've parsed some data (Open, High, Low, Close) of a security
via
read.table, which works fine. What I want to do now, is to perform a backtest of a simple trading strategy with R. Say, for example "buy on cross of MA(200) and MA(100)". Of
course
I could write the backtest routine by myself, but I saw a package called backtest. However, I do not really get the point how this may work.
How
could I use backtest package to analyse a simple strategy as above? Additionally, I would like to know, if there are some websites, wikis
etc.
which give a basic introduction to R in Finance "for dummies"?
Anything
I've
seen so far was more or less for professionals.
Thank you in advance
Alex
[[alternative HTML version deleted]]
_______________________________________________ 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
_______________________________________________ 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.
-- Ulrich Staudinger http://www.activequant.org Connect online: https://www.xing.com/profile/Ulrich_Staudinger
3 days later
Alex,
I have had the same bug, and found that in line:
s <- add.signal(s, name="sigCrossover", arguments =
list(data=quote(mktdata), columns=c("Close","SMA"), relationship="gt"),
label="Cl.gt.SMA")
change
columns=c("Close","SMA")
to
columns=c("Close","SMA10").
This bug was in a certain copy of the faber example only (don't remember
where I got that copy from).
Brian's latest link to a different copy of faber demo works fine.
Daniel
--
View this message in context: http://r.789695.n4.nabble.com/New-to-R-and-Finance-backtest-etc-tp3608005p3622522.html
Sent from the Rmetrics mailing list archive at Nabble.com.