I'm new to R, and after having read some examples of R code here , I tried to play a bit with it.
The first step was to get some data. I'm using Interactive Brokers, and as everybody knows, the datafeed is not very good, and you can't easily get a lot of historical data, as their have limitations.
With these limitations, you can't backtest (with NT for example) a large amount of data if you don't already have these data...
Anyway, the idea was to get 1 year of US stocks data from IB, so I used IBrokers CRAN package. This smart package know IB limits, and manage them (some sleep between each request).
The R script looks like this:
I have something like 600 symbols, and had generated this script with a Perl script, and was wondering how to do all in R.
I have a file (call it list.txt) which contains the symbol of stock I want to get, something like this:
So in R, I read the file:
so then I presume that my_file[3,1] == "ABT".
Now, if want to do something like
but something seems to be wrong in this.
Any idea ?
I'm sure it's a very simple problem for any R coder .
Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)