On Fri, Sep 27, 2013 at 5:33 PM, Joshua Ulrich <[email protected]> wrote:
> On Fri, Sep 27, 2013 at 7:17 PM, Mark Knecht <[email protected]> wrote:
>> Only slightly financial. Is there a function somewhere that implements
>> a real crossing check, as in MA1 crosses above MA2 and not just
>> MA1>MA2?. TTR seemed a likely candidate but I haven't found it there.
>>
> Yes, diff().
>
> library(quantmod)
> x <- Cl(getSymbols("SPY", auto.assign=FALSE))
> y <- EMA(x,10) > EMA(x,20)
> z <- merge(y, diff(y))
>
>> I alsa tried sos's findFn for searching, as well as stackoverflow but
>> it seems too general a question.
>>
>> Thanks,
>> Mark
>>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com

Thanks Joshua. Surprising answer but it certainly works.

Cheers,
Mark

_______________________________________________
[email protected] 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.

Reply via email to