[R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators
Joshua Ulrich
josh.m.ulrich at gmail.com
Wed Aug 6 18:37:59 CEST 2014
On Wed, Aug 6, 2014 at 11:32 AM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
> Mark,
>
> Are you using an outdated version of TTR? Josh had the same problem
> when he tried my demo.
>
It's not "outdated", it's just not the development version on R-Forge.
Please choose your words more carefully. Also, since you knew this
was a requirement to replicate the error, you should have included
that information in your initial email.
> My error isn't a "stop, program won't run" error, but a runtime error
> of my exit rules not working--that is, I only get a few entry orders
> filled, and then no exits ever.
>
> -Ilya
>
> On Wed, Aug 6, 2014 at 10:10 AM, Mark Knecht <markknecht at gmail.com> wrote:
>> On Tue, Aug 5, 2014 at 3:47 PM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
>>> Mark,
>>>
>>> Thanks for getting back to me. Since I'm using gmail, I didn't have any line
>>> wraps. However, I'm attaching my demo as an R file. Fixed the little typo.
>>>
>>> Thanks so much.
>>>
>>> -Ilya
>>>
>>
>> When using gmail ensure you have 'plain text' selected. (bottom right usually)
>>
>> When I run this code I see this as the first failure:
>>
>> [1] "Hammer_4TP"
>>>
>>> #apply strategy
>>> t1 <- Sys.time()
>>> out <- applyStrategy(strategy=strategy.st,portfolios=portfolio.st)
>> Error in `colnames<-`(`*tmp*`, value = c("XLB.Close.SMA.30",
>> "XLB.Close.SMA.10.sma1.SMA.30" :
>> length of 'dimnames' [2] not equal to array extent
>>> t2 <- Sys.time()
>>> print(t2-t1)
>> Time difference of 0.06236649 secs
>>>
>>
>> Is that the problem you are trying to solve?
>>
>> Generally it's good to be really clear about what you're asking for.
>> Show the code run, copy error messages, etc.
>>
>> - Mark
>
> _______________________________________________
> 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.
More information about the R-SIG-Finance
mailing list