logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Shelley  
#1 Posted : Wednesday, March 29, 2006 7:28:40 PM(UTC)
Shelley

Rank: Member

Groups: Registered, Registered Users
Joined: 2/7/2005(UTC)
Posts: 16
Location: BC

Hi Guys: I am looking for help writing an exploration that would capture one or more of these conditions using daily data. The tricky part is that I want the exploration to notify me when this happens in a monthly time frame. For example, stock xyz on a monthly chart shows the RSI is 65. At the end of the next month, the RSI is 73. During that month the stock has made significant gains. I want an exploration that will capture the day on which the RSI crossed 70 on a monthly chart. Further, the MACD looks like it is about to cross the baseline from negative to positive. At the end of the next month, it has. And/or the positive ADX is rising and the negative is falling. On a monthly chart it looks like they will intersect, with the positive crossing above the negative. At the end of the next month, this has happened, during which time the stock made significant gains. Can anyone help me with this? Jose Silva has written some code for weekly signals on daily charts but I do not know if anyone has written anything for monthly signals on daily charts. Thanks. Shelley
sportrider  
#2 Posted : Wednesday, March 29, 2006 7:45:37 PM(UTC)
sportrider

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/12/2005(UTC)
Posts: 141
Location: Brooklyn,NY

Hi Shelley, I'm not sure what it is that your looking for ;even though it sounds to me like a divergance type of situation.If it is then I think Jose's MACD divergence kit might be for you.I have never used but I recall that he said that it could look for divergences on different indicators not just MACD.
mstt  
#3 Posted : Wednesday, March 29, 2006 11:43:39 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Shelley I could provide you with code that alerts you when the monthly RSI crosses over 70, but what you need to understand is that this a dynamic process. The developing monthly RSI will have 20+ new values for the current month by the time the last daily bar is in place. The RSI might advance and retreat several times before the final monthly value is locked in. You'll need at least two years of data for approximate RSI(10) values, and for more accurate values, probably 4 to 5 years (still only 48 to 60 monthly bars). Create an indicator called "Monthly RSI", as below, and set "N" to the appropriate number of periods (months). Check the RSI values from this indicator by plotting it on a monthly chart and overlay it with the drop-down RSI function to verify that it's a good representation of RSI. Note down the last 2 or 3 values. Now switch to daily periodicity and check the indicator's last 2 or 3 (monthly) values - they should be the same (or at least very close) as the values you noted down. Assuming all is OK, change the X axis a few times (right click in the date area along the bottom of the chart), removing one daily bar from the right of the chart each time. Notice the dynamic nature of the last monthly RSI value - if the daily CLOSE changes so does the last value of the monthly RSI. If you're happy you can work with that then place "Fml("Monthly RSI")" in your exploration column (without quotes) and run it with a minimum of 500 bars (preferably 1000). Check a few results to make sure that the indicator works on more than just the test chart. If it does then you can refine your exploration to alert you of only the wanted RSI values, whether that be greater than, a crossover, or whatever. The exploration will run slowly. This is to be expected when 1000 bars of a PREV-based formula are scanned. Hope this helps. Roy MetaStock Tips & Tools {Monthly RSI} {© 2006 Roy Larsen, www.metastocktips.co.nz} {Use with EOD charts} {User settings} N:=Input("Monthly RSI Periods",2,99,10); Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1); {0, update at last bar of current month} {1, update on each new bar} {2, update on first bar of new month} {Timing module for monthly frames} A:=DayOfMonth(); G:=LastValue(Highest(Sum(A>27,5))=5); M:=G OR Month()<>ValueWhen(2,1,Month()); F:=G OR (M=0 AND PeakBars(1,Zig(A,1,$),1)=0); A:=LastValue(Cum(1)-1)=Cum(1); B:=ValueWhen(2,1,A); J:=If(F,1,If(Alert(F,2)=0 AND M,2,0)); J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J); J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J)); {CLOSE for monthly frames} K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C))); {Plot results} Pc:=1/N; Ua:=ValueWhen(1,J>0,K); Da:=ValueWhen(2,J>0,K); Ub:=If(Ua>Da,Ua-Da,0); Db:=If(Ua<Da,Da-Ua,0); U:=If(Cum(J>0)=N+1,Cum(If(J AND Cum(1)<>1,Ub, 0))/N,ValueWhen(1,J>0,PREV)*(1-Pc)+Ub*Pc); D:=If(Cum(J>0)=N+1,Cum(If(J AND Cum(1)<>1,Db, 0))/N,ValueWhen(1,J>0,PREV)*(1-Pc)+Db*Pc); D:=If(D=0,U,D); D:=ValueWhen(1,D>0,D); R:=100-(100/(1+(U/D))); If(ValueWhen(N+1,J,R)>0,R,R);
Shelley  
#4 Posted : Thursday, March 30, 2006 7:15:18 PM(UTC)
Shelley

Rank: Member

Groups: Registered, Registered Users
Joined: 2/7/2005(UTC)
Posts: 16
Location: BC

Hi Sportrider and Roy: Thanks very much for your replies! It may take me awhile to get back to you again but I will let you know how I make out. Shelley
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.