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

Ilya Kipnis ilya.kipnis at gmail.com
Wed Aug 6 21:20:41 CEST 2014


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 <markknecht at gmail.com> wrote:
> 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 <ilya.kipnis at gmail.com> 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 <ilya.kipnis at gmail.com> 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 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 additional functions. It's probably user error on my
>>> part, but I'm simply asking how I achieve what I'm trying to do.
>>>
>>> Thanks.
>>>
>>> -Ilya
>>>
>>> On Wed, Aug 6, 2014 at 12:50 PM, Mark Knecht <markknecht at gmail.com> wrote:
>>>> On Wed, Aug 6, 2014 at 9:43 AM, Ilya Kipnis <ilya.kipnis at gmail.com> wrote:
>>>>> Ah. Yeah, I'm using the latest R-forge version. But the issue I have
>>>>> exists beyond that.
>>>>>
>>>>
>>>> You replied to me only, which is fine.
>>>>
>>>> I would _strongly_ suggest that if your just learning quantstrat
>>>> (which I don't use but I responded to you as I've meant for a long
>>>> time to start learning) then try to minimize the example code down to
>>>> the bare minimum to create the error you want to ask about. A lot of
>>>> folks post complete examples to this list like you did and don't get
>>>> much of a response.
>>>>
>>>> Just my input, and as I say, I'm interested in the subject but not
>>>> such that I want to install lots of development packages as they might
>>>> have bugs that mess up other things I'm doing.
>>>>
>>>> HTH,
>>>> Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issueDemo.R
Type: application/octet-stream
Size: 2671 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140806/748e08da/attachment.obj>


More information about the R-SIG-Finance mailing list