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

Notification

Icon
Error

Options
Go to last post Go to first unread
robcpettit  
#1 Posted : Tuesday, August 16, 2005 11:10:34 PM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

in cola Ive put c, in colb ref(c,-41) and filter = cola>colb. This gives all the shares with price higher today than 41 weeks ago. (or 41 week moving average rising). What Id ideally like is the percentage of shares rising. So is there a way in the coloms of showing how many shares are scanned, and how many have higher prices then 41wks ago. this way I could calculate the two cols and get the percentage. Regards Robert
mstt  
#2 Posted : Wednesday, August 17, 2005 12:05:46 AM(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 Rob Yes there is a way to do this. The "global var" dll, GV.dll available from my website, facilitates using exploration columns as accumulators. The May issue of MSTT has an "advance/decline" exploration that works this way. For obvious reasons I'm reluctant to share that specific code in a public forum. However, if you look closely at the code for column A from http://www.metastocktips.co.nz/te_gv_le.txt (repeated below) you'll see how my Trade Equity profit column can be accumulated using the same technique. The trick is to create and zero all accumulators before running the exploration. This can be done by simply pulling a dummy indicator (with appropriate code, of course) onto a chart, then deleting it. Col A: $ Profit {Column A: $ Profit} {Net profit} Eq:=Fml("Trade Equity GV LE"); Tr:=ExtFml("GV.GetVar","Tr"); Cp:=ExtFml("GV.GetVar","Cp"); Equity:=ExtFml("GV.GetVar","Equity"); Trades:=ExtFml("GV.GetVar","Trades"); Equity:=ExtFml("GV.SetVar","Equity",Eq+Equity-Cp); Trades:=ExtFml("GV.SetVar","Trades",Trades+Tr); N:=ExtFml("GV.GetVar","N"); LastValue(Cum(N)); The code above is "dual purpose". It accumulates trades and equity from the Trade Equity GV LE indicator from all securities, but only reports final equity on a security by security basis. The code needs to be "re-jigged" to actually report the accumulation across all securities. Hope this helps Roy rlarsen@man.quik.co.nz
robcpettit  
#3 Posted : Wednesday, August 17, 2005 11:53:40 AM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

thankyou for you reply, alot to work with. Should keep out of trouble for a few days. If all else fails Il visit your site. Thanks Again Regards Robert
mstt  
#4 Posted : Thursday, August 18, 2005 12:17:42 AM(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 Robert Try loading these explorations. Set the first one to run on an index or an up-to-date security (only one is required). Run the second exploration across your test data. The first exploration sets up the date of the current bar so that the second exploration can determine whether to include a security in the advancing and total securities count. It also initializes the two variables used as counters. The second exploration checks each column used for valid volume (an active security), whether the close is greater than the close 41 periods ago, and whether the date is current. If all conditions are met the accumulators in columns A and B count advancing and active securities. Column C works out the percentage of advances - 100*advances/total (I hope). Run the explorations as a pair so that the correct date is loaded and the GV accumulators are set to zero. Hope this helps. I tried to send you the relevant MSTT issue but apparently I do not have your correct address. Regards Roy Exploration notes {Advancing Issues Clear & Setup - RP} {© 2004-2005 Roy Larsen} Reset global variables and set up current date of preferred index before running the scan. Requires Mark Pyle's GlobalVar dll (GV.dll). Col A: {Col A: Day} {Clear & Setup} ExtFml("GV.Clear"); A:= ExtFml("GV.SetVar","#UP",0); A:= ExtFml("GV.SetVar","#TOT",0); ExtFml("GV.SetVar","ScanDay",LastValue(DayOfMonth())); Col B: {Col B: Month} ExtFml("GV.SetVar","ScanMonth",LastValue(Month())); Col C: {Col C: Year} ExtFml("GV.SetVar","ScanYear",LastValue(Year())); Filter enabled No Periodicity Weekly Records required 50 Exploration notes {Advancing Issues Report - RP} {© 2004-2005 Roy Larsen} This exploration accumulates the number of both advancing and acive securities. Set "Load Records" to 50. Higher values might exclude some more recently listed issues. Once the exploration is completed the last value in each column gives the appropriate total. Out-of-order securities might result in the highest value appearing in the body of the report rather than at the end of it. Requires Mark Pyle's GlobalVar dll (GV.dll). Col A: {Col A: # Rises} {Advancing Issues} A:=LastValue(ExtFml("GV.GetVar","#UP")); D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); B:=D=DayOfMonth() AND M=Month() AND Y=Year() AND C>Ref(C,-41) AND V>0 AND Ref(V,-1)>0; D:=If(B,A+1,A); ExtFml("GV.SetVar","#UP",LastValue(D)); Col B: {Col B: # Active Securities} {Total Issues} A:=LastValue(ExtFml("GV.GetVar","#TOT")); D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); B:=D=DayOfMonth() AND M=Month() AND Y=Year() AND V>0 AND Ref(V,-1)>0; D:=If(B,A+1,A); ExtFml("GV.SetVar","#TOT",LastValue(D)); Col C: {Col C: # Same} {Unchanged Issues} A:=LastValue(ExtFml("GV.GetVar","#UP")); B:=LastValue(ExtFml("GV.GetVar","#TOT")); Int(100*A/B); Filter:{Filter} {discards issues if date not current} D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); D=DayOfMonth() AND M=Month() AND Y=Year() AND V>0 AND Ref(V,-1)>0; Filter enabled Yes Periodicity Weekly Records required 50
mstt  
#5 Posted : Thursday, August 18, 2005 12:26:42 AM(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)
Sorry, the "ExtFml("GV.Clear")" line in Column A of the first exploration is unnecessary, and it may be decidedly unhelpful if other GV-based indicators are in use at the same time. Roy Exploration notes{Advancing Issues Clear & Setup - RP} {Exploration notes: © 2004-2005 Roy Larsen} Reset global variables and set up current date of preferred index before running the scan. Requires Mark Pyle's GlobalVar dll (GV.dll). Col A: {Col A: Day} {Clear & Setup} A:= ExtFml("GV.SetVar","#UP",0); A:= ExtFml("GV.SetVar","#TOT",0); ExtFml("GV.SetVar","ScanDay",LastValue(DayOfMonth())); Col B: {Col B: Month} ExtFml("GV.SetVar","ScanMonth",LastValue(Month())); Col C: {Col C: Year} ExtFml("GV.SetVar","ScanYear",LastValue(Year())); Filter: {Filter:} Mov(C,LastValue(Max(3,Cum(1))),S)>0; Filter enabled Yes Periodicity Weekly Records required 50
mstt  
#6 Posted : Thursday, August 18, 2005 1:12:08 AM(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)
Here's a revised version of the second exploration in which the filter should actually work. Roy Exploration notes {Advancing Issues Report -RP} {© 2004-2005 Roy Larsen} This exploration accumulates the number of both advancing and active securities. Set "Load Records" to 50. Higher values might exclude some more recently listed issues. Once the exploration is completed the last value in each column gives the appropriate total. Out-of-order securities might result in the highest value appearing in the body of the report rather than at the end of it. Requires Mark Pyle's GlobalVar dll (GV.dll). Col A: AdvCount {Col A: # Rises} {Advancing Issues} A:=LastValue(ExtFml("GV.GetVar","#UP")); D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); {*} B:=D=DayOfMonth() AND M=Month() AND V>0 AND Ref(V,-1)>0 AND Y=Year() AND C>Ref(C,-41); D:=If(B,A+1,A); ExtFml("GV.SetVar","#UP",LastValue(D)); Col B: TotCount {Col B: # Active Securities} {Total Issues} A:=LastValue(ExtFml("GV.GetVar","#TOT")); D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); {*} B:=D=DayOfMonth() AND M=Month() AND Y=Year() AND V>0 AND Ref(V,-1)>0; D:=If(B,A+1,A); ExtFml("GV.SetVar","#TOT",LastValue(D)); Col C: Adv % {Col C: # Same} {Unchanged Issues} A:=LastValue(ExtFml("GV.GetVar","#UP")); B:=LastValue(ExtFml("GV.GetVar","#TOT")); Int(100*A/B); Col D: Advances {Col A: # Rises} {Advancing Issues} A:=LastValue(ExtFml("GV.GetVar","#UP")); D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); {*} D=DayOfMonth() AND M=Month() AND Y=Year() AND C>Ref(C,-41) AND V>0 AND Ref(V,-1)>0; Filter {Filter} {discards issues if date not current} D:=ExtFml("GV.GetVar","ScanDay"); M:=ExtFml("GV.GetVar","ScanMonth"); Y:=ExtFml("GV.GetVar","ScanYear"); DayOfMonth() AND M=Month() AND Y=Year() AND V>0 AND Ref(V,-1)>0 AND colD; Filter enabled Yes Periodicity Weekly Records required 50
robcpettit  
#7 Posted : Thursday, August 18, 2005 8:15:06 AM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

Thanks for all this info. Your time is greatly appreciated. Ill work through this and post my results. Regards Robert
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.