An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140805/ce6bf71e/attachment.pl>
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:
Okay, so my issue is that I'm trying to debunk a trading system I found online, and it involves using an indicator for a stop-loss and a take-profit type of order. I based my syntax on the luxor demo, aside from using an order.price argument, but I'm not sure of how to make the exact syntax work. Here's a minimum reproducible example.
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:
On Tue, Aug 5, 2014 at 2:58 PM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
Okay, so my issue is that I'm trying to debunk a trading system I found online, and it involves using an indicator for a stop-loss and a take-profit type of order. I based my syntax on the luxor demo, aside
from
using an order.price argument, but I'm not sure of how to make the exact syntax work. Here's a minimum reproducible example.
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
-------------- 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:
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
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 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
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.
On Wed, Aug 6, 2014 at 9:37 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
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.
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