Arc Forumnew | comments | leaders | submitlogin
Personal market scanner (blackstag.com)
3 points by thaddeus 5405 days ago | 13 comments


1 point by thaddeus 5405 days ago | link

My my own personal market scanner I developed using Arc, jQuery & jqGrid.

Using every stock symbol on the TSX & TSXV the app goes out and web scrapes the last 200 days of history from well known sites on the internet. It parses the files, loads into memory, creates a few data factors, and stores only the data of interest.

The interface code is jqGrid ( http://www.trirand.com/blog/ ) Have a look, I've been pretty impressed as the plugin has so many options, configurations and integration points. One nice thing about it is that it already handles JSON for data feeds and callbacks. Arc, as you may know, has a few handy json parser/combinators for use: (see http://awwx.ws/). One thing about jqGrid is that it can be brutally slow on IE6. Anyone find any grids that work well on IE6? Any insight here?

I've limited the data set to OG (Oil & Gas) just so I limit the page load and I will only leave up until Monday (by then I have to use to find my stocks again). Check out the buttons on the bottom, there are some hidden fields to filter on. I chose the factors based upon Stan Weinstein's book: ( http://books.google.ca/books?id=k7dJZbOOkLEC&printsec=fr... )

I am posting the example for discussion sake. I don't plan to release the code since it's too heavily integrated into a larger body of code. There's client side code for jqGrid that's exposed in the app if you're interested and I am more than willing to answer questions.

-----

1 point by akkartik 5404 days ago | link

Ah, here's a technical question: are you using arc for html parsing? I couldn't see how to, so I just built my crawler with python and beautifulsoup writing json.

-----

1 point by thaddeus 5404 days ago | link

yep.

http://github.com/nex3/arc/tree/arc2.master/lib/http-get/

From there I just built some custom arc functions to parse the file out.

Here's an example:

  (def file-linefeed->list (path+file)
	(accum tolist 
	   (w/infile inf path+file 
		  (whiler line (readline inf) nil 
		      (tolist line)))))

   (= myfilelist (file-linefeed->list path+file))
Then just step through myfilelist and find what you're looking for.

Don't forget to use aws readline, or line returns will not load correctly.

-----

1 point by akkartik 5404 days ago | link

So it seems you don't need full-blown html parsing for your scraper.

-----

1 point by thaddeus 5404 days ago | link

Correct.

I just find the subset lines by finding start & end indicator points then write a custom parser for the subset section. I might be wrong, but for my needs a full-blown html parser would be much slower and I'm hitting the same file structure every time (for each stock).

-----

2 points by akkartik 5404 days ago | link

Yes, that def seems reasonable.

Arc is missing an html parser; I may take care of it. It doesn't have to be built in arc, just be callable from within arc.

-----

1 point by thaddeus 5404 days ago | link

I vaguely remember trying this out long time ago... which may help out.

http://github.com/nex3/arc/blob/arc2.master/lib/xml.arc

-----

1 point by akkartik 5405 days ago | link

Are the highest/lowest columns based on 200 days of history? Is there ability to drill down that I'm missing?

-----

1 point by thaddeus 5405 days ago | link

All data is limited to the last 200 days so yes, but I don't store lowest, just highest and last and price prior to last. I plan to add more stuff, but I just got the basic stuff I need.

The Volume & Price Factors are the % of the last relative to the highest. I.E. Volume Factor 300 means the last volume is 300% greater than the highest (in 200 days), 100% means they are equal.

Price Pop is the percent the last is relative to the prior.

You can drill down by creating a query using the magnifying glass at the bottom.

You can move column order by using drag/drop within the column dialog.

jqGrid has soo many options :)

-----

1 point by akkartik 5405 days ago | link

So highest volume/price columns are normalized? or is it the latest columns.

How would a factor of highest ever be greater than 100%?

-----

1 point by thaddeus 5405 days ago | link

Good questions- I was expecting technology questions. lol. :)

They are the highest 'close' attributes in the last 200 days. The volume would be the total volume for a day. The price would be the close price for a day.

The highest excludes the last close.

Header descriptions could be much better as you point out... I wasn't too worried as I had no plans for a product.

-----

1 point by akkartik 5405 days ago | link

Cool. What do you do with this? Does it help you make trading decisions?

-----

1 point by thaddeus 5405 days ago | link

Yep.

Helps me find stocks breaking out (moving from stage 1 to stage 2 in stan weinsteins book).

I don't buy based solely on this, but the whole process helps me to remove some of the unwanted human emotion when investing.

-----