<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-5815834906618132494.post3058745081573813777..comments</id><updated>2010-02-17T21:13:23.737-06:00</updated><category term='xts'/><category term='Code'/><category term='Interactive Brokers'/><category term='Drawdown'/><category term='LSPM'/><category term='quantmod'/><category term='Data'/><category term='Releases'/><category term='HIstorical Data'/><category term='blotter'/><category term='quantstrat'/><category term='Events'/><category term='TTR'/><category term='API'/><category term='IBrokers'/><category term='Examples'/><category term='R'/><category term='Excel'/><title type='text'>Comments on FOSS Trading: David Varadi's RSI(2) alternative</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.fosstrading.com/feeds/3058745081573813777/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html'/><author><name>Joshua Ulrich</name><uri>https://profiles.google.com/101580259945483587604</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-cNBfNQ-0tKE/AAAAAAAAAAI/AAAAAAAAAAA/QxKaQjp1h4M/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-3009072971286634569</id><published>2010-02-17T21:13:23.737-06:00</published><updated>2010-02-17T21:13:23.737-06:00</updated><title type='text'>jipibelanger,

The result should always be an xts ...</title><content type='html'>jipibelanger,&lt;br /&gt;&lt;br /&gt;The result should always be an xts object.  I&amp;#39;m not sure how you&amp;#39;re getting a &amp;quot;list&amp;quot;, but the high / low data prior to 1980 is poor for most Yahoo data.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/3009072971286634569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/3009072971286634569'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1266462803737#c3009072971286634569' title=''/><author><name>Joshua Ulrich</name><uri>http://www.blogger.com/profile/16641971932645230429</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1996417509'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-486104094551661431</id><published>2010-02-17T16:05:42.079-06:00</published><updated>2010-02-17T16:05:42.079-06:00</updated><title type='text'>Hello Joshua,
Is there a reason why the result is ...</title><content type='html'>Hello Joshua,&lt;br /&gt;Is there a reason why the result is sometimes of typeof &amp;quot;list&amp;quot; instead of &amp;quot;doubles&amp;quot; ?&lt;br /&gt;&lt;br /&gt;When I load my datas from 1970 with quantmod the result is typeof &amp;quot;list&amp;quot;; and when I start from 1980 the result is typeof &amp;quot;double&amp;quot;.&lt;br /&gt;&lt;br /&gt;Thank you.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/486104094551661431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/486104094551661431'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1266444342079#c486104094551661431' title=''/><author><name>jipibelanger</name><uri>http://www.blogger.com/profile/17745443780811874563</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-484035034'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-6656106465745290187</id><published>2009-07-24T16:56:00.679-05:00</published><updated>2009-07-24T16:56:00.679-05:00</updated><title type='text'>The solution I posted above is better.  You just h...</title><content type='html'>The solution I posted above is better.  You just have to change the &amp;quot;n&amp;quot; for the RSI function to &amp;quot;14&amp;quot; and the upper and lower bounds in the ifelse() statements to 80 and 20.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/6656106465745290187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/6656106465745290187'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1248472560679#c6656106465745290187' title=''/><author><name>Joshua Ulrich</name><uri>http://www.blogger.com/profile/16641971932645230429</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1996417509'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-505335600875773607</id><published>2009-07-24T15:50:08.453-05:00</published><updated>2009-07-24T15:50:08.453-05:00</updated><title type='text'>Thanks
Actually  I am testing RSI(price,14), so th...</title><content type='html'>Thanks&lt;br /&gt;Actually  I am testing RSI(price,14), so the indicator may be under 20 or above 80 for a time and I use FOR loop instead of ifelse and lag but FOR is slow in R.&lt;br /&gt;&lt;br /&gt;Is there any better solution?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/505335600875773607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/505335600875773607'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1248468608453#c505335600875773607' title=''/><author><name>Bear</name><uri>http://www.blogger.com/profile/10301431975043826550</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-836956210'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-7802594037487260774</id><published>2009-07-24T13:09:55.203-05:00</published><updated>2009-07-24T13:09:55.203-05:00</updated><title type='text'>Hi Bear,

You need to use a lagged value of RSI in...</title><content type='html'>Hi Bear,&lt;br /&gt;&lt;br /&gt;You need to use a lagged value of RSI in addition to the current value.  The code below shows how to do it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;library(TTR)&lt;br /&gt;price &amp;lt;- .xts(20*cumprod(1+rnorm(50)/100),Sys.Date()-50:1)&lt;br /&gt;rsi &amp;lt;- RSI(price,2)&lt;br /&gt;rsiLag &amp;lt;- lag(rsi)&lt;br /&gt;sig &amp;lt;- rep(0,50)&lt;br /&gt;sig &amp;lt;- ifelse(rsiLag &amp;gt; 90 &amp;amp; rsi &amp;lt; 90, -1, sig)&lt;br /&gt;sig &amp;lt;- ifelse(rsiLag &amp;lt; 10 &amp;amp; rsi &amp;gt; 10,  1, sig)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So &lt;b&gt;sig&lt;/b&gt; will be &amp;#39;1&amp;#39; if yesterday&amp;#39;s RSI (&lt;b&gt;rsiLag&lt;/b&gt;) is less than 10 and today&amp;#39;s RSI (&lt;b&gt;rsi&lt;/b&gt;) is greater than 10.&lt;br /&gt;&lt;br /&gt;Hope that helps,&lt;br /&gt;Josh</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/7802594037487260774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/7802594037487260774'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1248458995203#c7802594037487260774' title=''/><author><name>Joshua Ulrich</name><uri>http://www.blogger.com/profile/16641971932645230429</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1996417509'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-1136352025234462819</id><published>2009-07-23T16:57:04.533-05:00</published><updated>2009-07-23T16:57:04.533-05:00</updated><title type='text'>hello josh,
If I want to sell the stock when the R...</title><content type='html'>hello josh,&lt;br /&gt;If I want to sell the stock when the RSI retereat from the 90 or buy it when the RSI above 10 again how can I modify the code?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/1136352025234462819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/3058745081573813777/comments/default/1136352025234462819'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html?showComment=1248386224533#c1136352025234462819' title=''/><author><name>Bear</name><uri>http://www.blogger.com/profile/10301431975043826550</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2009/07/david-varadis-rsi2-alternative.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-3058745081573813777' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/3058745081573813777' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-836956210'/></entry></feed>
