Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Ilya Kipnis
Mark, The corrected version is attached. I had my link incorrect. But I got the correct syntax now. I've never actually seen this nuance until now, so this is pretty cool to me. -Ilya On Wed, Aug 6, 2014 at 3:14 PM, Mark Knecht wrote: > Please share the changes to the code for others that come

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Mark Knecht
Please share the changes to the code for others that come later! Cheers, Mark On Wed, Aug 6, 2014 at 12:12 PM, Ilya Kipnis wrote: > Fixed! I wasn't specifying my parent on the entry. But the > exit-on-indicator works now. Got it, all clear. > > On Wed, Aug 6, 2014 at 2:50 PM, Ilya Kipnis wrote:

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Ilya Kipnis
Fixed! I wasn't specifying my parent on the entry. But the exit-on-indicator works now. Got it, all clear. On Wed, Aug 6, 2014 at 2:50 PM, Ilya Kipnis wrote: > Alright, here's a code that contains the absolute bare minimum. It's a > simple SMA5/SMA10 crossover strategy, with an entry a stoplimit

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Ilya Kipnis
Alright, here's a code that contains the absolute bare minimum. It's a simple SMA5/SMA10 crossover strategy, with an entry a stoplimit on seeing the signal, and an exit of the price immediately crossing below the SMA10, mid-bar. I'm trying to set a stop loss on the second SMA. I removed all of my a

Re: [R-SIG-Finance] chartSerieries (quantmod) : data range

2014-08-06 Thread Robert Iquiapaza
Hannu, your data is a little bit different from yahoo, as you have only one series this should work sdf <- read.table("sdf.txt", header=T,as.is=T) str(sdf) SDF2 = timeSeries(round(sdf[,2],3), sdf[,1]) chartSeries(SDF2,theme=chartTheme('white'),TA=NULL) str(sdf) 'data.frame':235 obs. of

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Mark Knecht
On Wed, Aug 6, 2014 at 9:37 AM, Joshua Ulrich wrote: > On Wed, Aug 6, 2014 at 11:32 AM, Ilya Kipnis 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. > Ple

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Joshua Ulrich
On Wed, Aug 6, 2014 at 11:32 AM, Ilya Kipnis 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

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Ilya Kipnis
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 a

Re: [R-SIG-Finance] Need help getting stop-loss and take-profit orders to work with indicators

2014-08-06 Thread Mark Knecht
On Tue, Aug 5, 2014 at 3:47 PM, Ilya Kipnis 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' se

Re: [R-SIG-Finance] chartSerieries (quantmod) : data range

2014-08-06 Thread Robert Iquiapaza
This works : Ibov=getSymbols('^BVSP', src='yahoo',from='2000-01-01',auto.assign=FALSE) IBOV <- to.monthly(Ibov,indexAt='lastof')["2000-08-31/2014-07-31"] chartSeries(IBOV,theme=chartTheme('white'),TA=NULL) names = index(IBOV) IBOV = timeSeries(IBOV, names) chartSeries(IBOV,theme=chartTheme('white'

[R-SIG-Finance] chartSerieries (quantmod) : data range

2014-08-06 Thread Hannu Kahra
Hi, I apply the chartSeries (quantmod) function to plot a time series. The function provides the data range on top of the graph: [1994-06-01 03:00:00/2013-12-01 02:00:00]. The data are monthly from 1994-06-01 through 2013-12-01. Is it possible to get rid of the range in the graph, or have it [1