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

Notification

Icon
Error

Options
Go to last post Go to first unread
virginiatrader  
#1 Posted : Wednesday, April 26, 2006 1:28:36 AM(UTC)
virginiatrader

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/18/2005(UTC)
Posts: 8
Location: Virginia

Hello to all: Can someone among our knowledgable selves provide insight on how to create a variant on the stock market advance-decline line, i.e., I wish to create an indicator for use in any market, stocks or futures, that sums, in a cumulative fashion, the daily up-closes and down-closes, and then subtracts the down-closes from the up-closes for a net change indicator. All help and guidance is appreciated and thanked in advance. Many regards, virginiatrader
hayseed  
#2 Posted : Wednesday, April 26, 2006 2:24:51 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey virginatrader..... that sorta sounds like the collection of broad market indicators..... many of which should be in the indicator list, at least in versions 9 and above..... that type of indicator will not work under all conditions....... but they are informitive nonetheless..... h
from equis {This indicator subtracts the number of Advancing Issues from the number of Declining Issues using data from the NASDAQ exchange.} Security("C:\\MetaStock Data\\BM Data\\X.NASD-A",C)- Security("C:\\MetaStock Data\\BM Data\\X.NASD-D",C)
or something similiar
a:=( Fml( "BM NASDAQ Advancing Issues") - Fml( "BM NASDAQ Declining Issues")) / (Fml( "BM NASDAQ Declining Issues") + Fml( "BM NASDAQ Advancing Issues")); b:= a * 1000; Mov(b,19,E)-Mov(b,39,E) --------------------------------
virginiatrader  
#3 Posted : Wednesday, April 26, 2006 10:21:09 AM(UTC)
virginiatrader

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/18/2005(UTC)
Posts: 8
Location: Virginia

Hayseed- Thanks for the quick reply. I knew that those choices were there; however, their construction involves the use of multiple data streams. All I wish to do is to cumulatively sum the up and down closes for a single data stream, such as the 10y Note. But perhaps I am overlooking their usage in this instance? Please comment and advise, and many regards, virginiatrader
hayseed  
#4 Posted : Wednesday, April 26, 2006 12:19:06 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey virginatrader.... might need to take a closer look but this appears to keep a running tally of the up days minus the down days...... still studyin on it.....h added the variable below, kinda bet making the close into a variable such as open/close/high/low and such would be interesting.... carrying it abit further, having something like "a:=Cum(If(O>Ref(C,-pds ),1,0));" might keep a running tally of the gap ups.... "a:=Cum(If(O<Ref(C,-pds ),1,0));" might keep a running tally of the gap downs......all those could be incorporated into a single indicator.... your idea keeps sounding better and better.... h
a:=Cum(If(C>Ref(C,-1 ),1,0)); b:=Cum(If(C<Ref(C,-1),-1,0)); d:=a+b; d
or variable style
pds:=Input("periods",1,100,1); a:=Cum(If(C>Ref(C,-pds ),1,0)); b:=Cum(If(C<Ref(C,-pds),-1,0)); d:=a+b; d
somewhat larger scope, including open,high,low,gaps
pds:=Input("periods",1,100,1); pnt:=Input("c=1, o=2, h=3, l=4, 5=gapup, 6=gapdown, 7=5-6",1,7,1); a:=Cum(If(C>Ref(C,-pds ),1,If(C<Ref(C,-pds),-1,0))); b:=Cum(If(O>Ref(O,-pds ),1,If(O<Ref(O,-pds),-1,0))); aa:=Cum(If(H>Ref(H,-pds ),1,If(H<Ref(H,-pds),-1,0))); bb:=Cum(If(L>Ref(L,-pds ),1,If(L<Ref(L,-pds),-1,0))); aaa:=Cum(If(O>Ref(c,-pds ),1,0)); [color=red:d1cac64fe7]corrected ref from open to close[/color] bbb:=Cum(If(O<Ref(c,-pds ),1,0)); [color=red:d1cac64fe7]corrected ref from open to close[/color] aaaa:=aaa-bbb; plot:=If(pnt=1,a,If(pnt=2,b,If(pnt=3,aa,If(pnt=4,bb,If(pnt=5,aaa,If(pnt=6,bbb,If(pnt=7,aaaa,a))))))); plot -----------------------------------------
virginiatrader  
#5 Posted : Thursday, April 27, 2006 12:46:27 AM(UTC)
virginiatrader

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/18/2005(UTC)
Posts: 8
Location: Virginia

H- Thanks for the help! Just plugged the code into MS, all variants are interesting. I overlaid the basic indicator (called it UD Index..pretty catchy, a?!) on the 10y Note candlestick chart, with no indicator scaling, and it appears to function as expected, showing several interesting divergences between price and plot. The I created a McClellan Oscillator or MACD-style indicator, short term EMA minus a long term EMA, and this appears to function as expected. I like your thoughts of expanding the scope of the indicator with the inclusion of the OHLC price fields, and the efforts to deal with gap openings. However, when I plugged these codes into MS, they derived ZIG-ZAG style indicators as I lengthen the periods measured. An interesting effect. Will be looking at including volume in the mix, somewhat like a Chaikin Oscillator, and maybe Open Interest, and would appreciate any follow-on input from you. Regards, virginiatrader
hayseed  
#6 Posted : Thursday, April 27, 2006 3:18:38 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey virginatrader.... added the v and oi along with some playing around with 'Cum(If(H-O>Ref(O-L,-pds ),1,If(H-O<Ref(O-L,-pds),-1,0)));' ..... something else that would be handy might be adding the date range funtion.... esp if it would count between those dates and not from the begining of the chart and start a 0.... will study on it more.....h
pds:=Input("periods",1,100,1); pnt:=Input("C=1, O=2, H=3, L=4, 5=gapup, 6=gapdown, 7=5-6",1,12,1); blank:=Input("8= sum (H-O)<>(O-L) , 9=V, 10=OI, 11=(H-O)-(O-L) ",0,0,0); pds2:=Input("moving average periods",1,100,10); a:=Cum(If(C>Ref(C,-pds ),1,If(C<Ref(C,-pds),-1,0))); b:=Cum(If(O>Ref(O,-pds ),1,If(O<Ref(O,-pds),-1,0))); aa:=Cum(If(H>Ref(H,-pds ),1,If(H<Ref(H,-pds),-1,0))); bb:=Cum(If(L>Ref(L,-pds ),1,If(L<Ref(L,-pds),-1,0))); aaa:=Cum(If(O>Ref(C,-pds ),1,0)); bbb:=Cum(If(O<Ref(C,-pds ),1,0)); aaaa:=aaa-bbb; bbbb:=Cum(If(H-O>Ref(O-L,-pds ),1,If(H-O<Ref(O-L,-pds),-1,0))); aaaaa:=Cum((H-O) - (O-L)); d:=Cum(If(V>Ref(V,-pds ),1,If(V<Ref(V,-pds),-1,0))); dd:=Cum(If(OI>Ref(OI,-pds ),1,If(OI<Ref(OI,-pds),-1,0))); plot:=If(pnt=1,a,If(pnt=2,b,If(pnt=3,aa,If(pnt=4,bb,If(pnt=5,aaa,If(pnt=6,bbb,If(pnt=7,aaaa, If(pnt=8,bbbb,If(pnt=9,d,If(pnt=10,dd,If(pnt=11,aaaaa,a))))))))))); plot; Mov(plot,pds2,S) -------------------------------------------------------------
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.