new to this mailing list and not very proficient with R in general yet, so
apologies in advance.
all of the demos I could see were using stock data pulled from
yahoo/google, etc -- mine is coming from bloomberg. I did my best to
replicate the type of object that getsymbols() seems to create.
everything seems to be working alright until I actually get to
applystrategy(), where I am getting an error that I imagine, while not
particularly helpful to me, will be completely obvious to somebody with a
bit more experience. the error i'm receiving is
Error in n < 1 :
comparison (3) is possible only for atomic and list types
code below. Any help is greatly appreciated and apologies for all the rules
I am surely breaking, I'll plead first-timer on this one.
As mentioned by Ilya, your arguments to SMA are incorrect. Also your
program is missing the signal function. You need to convert your indicator
into a signal using add.signal function before passing it to a rule. Try
running the modified code -
ah - i shortened the dataset for brevity, didn't think about the SMA (the
actual dataset is far larger). I also see that in the add.indicator call i
used n=SMA where it should have been n=nSMA.
Thanks so much for your quick reply. I actually had a couple other bits
missing but I've got it up and running now (or at least I have it posting
transaction data on applystrategy() which is a massive step forward).