Skip to content

Need help getting stop-loss and take-profit orders to work with indicators

7 messages · Ilya Kipnis, Mark Knecht, Joshua Ulrich

#
On Tue, Aug 5, 2014 at 2:58 PM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
The email was apparently sent as HTML, got wrapped and the commented
out sections are causing problems.

There also seems to be a missing comma in the add.rule(strategy.st,
name="ruleSignal" are at the end of the order.price line.

I suggest you try cleaning those code issue up  - shorten the lines so
they don't wrap, and sending the clean code in text mode.

Good luck,
Mark
#
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
On Tue, Aug 5, 2014 at 6:40 PM, Mark Knecht <markknecht at gmail.com> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140805/7337dfd4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hammerDemo.R
Type: application/octet-stream
Size: 8138 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140805/7337dfd4/attachment.obj>
#
On Tue, Aug 5, 2014 at 3:47 PM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
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"
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
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
#
Mark,

Are you using an outdated version of TTR? Josh had the same problem
when he tried my demo.

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 Wed, Aug 6, 2014 at 11:32 AM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
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.
#
On Wed, Aug 6, 2014 at 9:37 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
Ah, then that answers it. I'm not using the version Joshua is talking
about. I'm using 0.22-0 which is what's offered as the latest in RStudio.

- Mark