<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/pgnetted/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 17 Oct 2011 09:30:47 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pgnetted/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v17 
+++ v18 
@@ -159,6 +159,7 @@
 [[img src=pgstocked_browser.jpg]]
 
 &lt;br&gt;&lt;br&gt;By today you are also able to plot your data as a binary image (jpg):
+
 ~~~~~~
 select pgstocked.calc_indicators('`', '´'
  ,'select close,dte from pgstocked.quotes 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Mon, 17 Oct 2011 09:30:47 -0000</pubDate><guid>https://sourceforge.net5c10ffe323ee9db6d6153e0a3866f5046c6ac43d</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v16 
+++ v17 
@@ -156,20 +156,23 @@
 
 &lt;br&gt;&lt;br&gt;To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
 
-~~~~~~
+[[img src=pgstocked_browser.jpg]]
+
+&lt;br&gt;&lt;br&gt;By today you are also able to plot your data as a binary image (jpg):
+~~~~~~
 select pgstocked.calc_indicators('`', '´'
  ,'select close,dte from pgstocked.quotes 
    where fi_id = 3133 and dte &gt;= ''2010-10-01'' 
    order by dte desc, tme desc'
  ,'a=Talib.calc("sma", `close(0)-close(-1)´, 20).get(0);
    RGBColor red = new RGBColor(255,0,0);
    Plot("main","main","line", red, close);
    Plot();   
    Return("close", "a");'
 );
 ~~~~~~
 
-[[img src=pgstocked_browser.jpg]]
+[[img src=test_0.9237413925999745.jpg]]
 
 
 And this is what you get
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Mon, 17 Oct 2011 09:29:58 -0000</pubDate><guid>https://sourceforge.net077963e7409c8baa68a80bb1f3e56eb565ada5b4</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v15 
+++ v16 
@@ -156,6 +156,19 @@
 
 &lt;br&gt;&lt;br&gt;To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
 
+~~~~~~
+select pgstocked.calc_indicators('`', '´'
+ ,'select close,dte from pgstocked.quotes 
+   where fi_id = 3133 and dte &gt;= ''2010-10-01'' 
+   order by dte desc, tme desc'
+ ,'a=Talib.calc("sma", `close(0)-close(-1)´, 20).get(0);
+   RGBColor red = new RGBColor(255,0,0);
+   Plot("main","main","line", red, close);
+   Plot();   
+   Return("close", "a");'
+);
+~~~~~~
+
 [[img src=pgstocked_browser.jpg]]
 
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Mon, 17 Oct 2011 09:27:02 -0000</pubDate><guid>https://sourceforge.net8fdf74d8e63a637a857d4b0ad23198fc791d55cc</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v14 
+++ v15 
@@ -76,58 +76,85 @@
 select scrap4('yahoo_eod', 'symbol=&gt;^DJI, 'job_start_run=&gt;2011-01-01 00:00:00'::hstore, null);
 ~~~~~~
 
-If yahoo changes its URL, just change the line in the script an you are done. This makes scrapper maintenance pretty easy. A simple SQL script will fix that within a second, no compiler needed. 
-
+&lt;br&gt;If yahoo changes its URL, just change the line in the script an you are done. This makes scrapper maintenance pretty easy. A simple SQL script will fix that within a second, no compiler needed. 
+
 Since we are using Java, Beanshell and HtmlUnit any complex web scrapper is imagine able. In example filling forms or reading java script streams (real time data). Using data from different sources like files or JDBC data sources is also possible with ease.
 
 By using PgAgent it is easy to schedule regular scrappers. And with the implemented process queue it is possible to do asynchronous (scrapper) tasks in parallel. 
 
 Once scrapping data is finished a trigger get fired and executes so called _subscribers _ (asynchronous without any affect to the current transaction). Subscribers are responsible to load data into PgStocked or reschedule other scrapping tasks.
 
 PgStocked
 ----
 Within PgStocked your data gets organised and prepared to data mine. The goal is not to simply store stupid eod data, the goal is to store anything! Since _anything_ is hard do declare the data structure have to be flexible enough to do so. Lets imagine the following situation: You are developing a trading strategy based on candle sticks. So all you need is simple stupid bar data (open, high, low, close, volume). But now you want to use your strategy only on companies with a gaining EBITDA. What can you do? With PgStocked you do not have to care about data structure just organise a feed (scrapper) for your needed data and feed it. On another day you hear about using tweets to predict stock prices. You think this would be interesting and you would like to give it a try. What can you do? Prototyping in Excel? No, just organise a feed and propagate it to your PgStocked.
 
 Once all the needed data is collected and stored, of course we want to do something cool with them :-) In PgStocked you can – as you could with PgNetted – use the Beanshell scripting engine. At this time an easy access to a Talib implementation is available too. Now with Java an Talib we can do pretty nice things like for example calculating am simple 20 day moving average over the prive movement (todays prince – yesterdays price):
 
 ~~~~~~
 set client_encoding to 'WIN1252';
 select pgstocked.calc_indicators('`', '´'
  ,'select dte, close from pgstocked.quotes where fi_id = 3133 order by dte desc, tme desc'
  ,'New ("cool"); cool=Talib.calc("sma", `close(0)-close(-1)´, 20).get(0);
    Return("dte", "close", "cool");'
 );
 select * from tmp_resultset;
 
 id  |         cool         |    dte     | close
 ----+----------------------+------------+-------
   0 | -0.00750000000000001 | 2011-10-07 |  1.66
   1 | -0.00700000000000001 | 2011-10-06 |  1.66
   2 |                -0.01 | 2011-10-05 |  1.65
   3 |                -0.01 | 2011-10-04 |  1.65
   4 | -0.00800000000000001 | 2011-10-03 |   1.7
   5 | -0.00750000000000001 | 2011-09-30 |   1.7
   6 | -0.00700000000000001 | 2011-09-29 |   1.7
   7 |                    0 | 2011-09-28 |  1.75
   8 |               0.0015 | 2011-09-27 |  1.77
   9 |               0.0025 | 2011-09-26 |   1.8
  10 |              -0.0025 | 2011-09-23 |  1.75
  11 |               0.0015 | 2011-09-22 |  1.79
  12 |               0.0035 | 2011-09-21 |   1.8
  13 |               0.0015 | 2011-09-20 |  1.81
  14 |                0.003 | 2011-09-19 |  1.81
  15 |               0.0045 | 2011-09-16 |  1.82
  16 |  0.00650000000000001 | 2011-09-15 |  1.83
  17 |  0.00750000000000001 | 2011-09-14 |  1.85
  18 |                 0.01 | 2011-09-13 |  1.87
  19 |  0.00700000000000001 | 2011-09-12 |  1.81
  20 |               0.0055 | 2011-09-09 |  1.81
  21 |               0.0025 | 2011-09-08 |   1.8
  22 |  0.00600000000000001 | 2011-09-07 |  1.85
 ~~~~~~
 
-
-To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
+&lt;br&gt;&lt;br&gt;The first two arguments define a open / close character to indicate that you want to loop through an array (day-by-day or better qoute-by-quote). This is evaluated first and finally represented as an array. Note that you need to pass an offset to your variable name so close(0) is _t_ and close(-1) is _t-1_. You even can loop inside a quote-by-quote sub routine:
+
+~~~~~~
+-- weighted average made by foot:
+
+set client_encoding to 'WIN1252';
+select pgstocked.calc_indicators('`', '´'
+ ,'select close,dte from pgstocked.quotes where fi_id = 3133 order by dte desc, tme desc'
+ ,'New("test"); test=`Double c=0; for(int i=0;i&gt;-20;i--){c+=close(i)*(i+20);}; return c / 210;´;Return("close","test");'
+);
+~~~~~~
+
+&lt;br&gt;And of corse you can combine any variant:
+
+~~~~~~
+set client_encoding to 'WIN1252';
+select pgstocked.calc_indicators('`', '´'
+ ,'select close,dte from pgstocked.quotes where fi_id = 3133 order by dte desc, tme desc'
+ ,'New("test"); 
+   test=Talib.calc("sma", `Double c=0; for(int i=0;i&gt;-20;i--){c+=close(i)*(i+20);}; return c / 210;´, 10).get(0);
+   New("testDelta"); testDelta=`test(0)-close(0)´;
+   Return("close","test", "testDelta");'
+);
+
+select * from tmp_resultset;
+~~~~~~
+
+
+&lt;br&gt;&lt;br&gt;To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
 
 [[img src=pgstocked_browser.jpg]]
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Thu, 13 Oct 2011 07:05:17 -0000</pubDate><guid>https://sourceforge.net4e3c0c60f6d7c2fb01251f6a6452f02e2093a09c</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v13 
+++ v14 
@@ -126,6 +126,7 @@
  22 |  0.00600000000000001 | 2011-09-07 |  1.85
 ~~~~~~
 
+
 To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
 
 [[img src=pgstocked_browser.jpg]]
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 11:34:56 -0000</pubDate><guid>https://sourceforge.netef82aa167ec1f430c414746c951a886255950496</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v12 
+++ v13 
@@ -80,13 +80,15 @@
 
 Since we are using Java, Beanshell and HtmlUnit any complex web scrapper is imagine able. In example filling forms or reading java script streams (real time data). Using data from different sources like files or JDBC data sources is also possible with ease.
 
-With PgAgent it is easily schedule regular scrappers. And with the implemented process queue it is possible to do asynchronous (scrapper) tasks in parallel. Once scrapping data is finished a trigger is fired and executes so called _subscribers _ (asynchronous without any affect to the current transaction). Subscribers are responsible to load data into PgStocked or reschedule another scrapping task.
-
+By using PgAgent it is easy to schedule regular scrappers. And with the implemented process queue it is possible to do asynchronous (scrapper) tasks in parallel. 
+
+Once scrapping data is finished a trigger get fired and executes so called _subscribers _ (asynchronous without any affect to the current transaction). Subscribers are responsible to load data into PgStocked or reschedule other scrapping tasks.
+
 PgStocked
 ----
-Within PgStocked your data gets organised and data mined. The goal is not to simply store stupid eod data, the goal is to store anything! Since _anything_ is hard do declare the data structure have to flexible enough to do so. Lets imagine the following situation: You are developing a trading strategy based on candle sticks. So all you need is simple stupid bar data (open, high, low, close, volume). But now you want to use your strategy only on companies with a gaining EBITDA. What can you do? With PgStocked you do not have to care about data structure just organise a feed (scrapper) for your needed data and feed it. And then, on another day you heard about using tweets to predict stock prices. You think this would be interesting and you would like to give it a try. What can you do? Prototyping in Excel? No, just organise a feed and propagate your data to PgStocked.
-
-Once all the needed data is collected and stored, of course we want to do something cool with them. In PgStocked you can – as you could with PgNetted – use the Beanshell scripting engine. At this time an easy access to a Talib implementation is available too. Now with Java an Talib we can do pretty nice things like for example calculating am simple 20 day moving average over the prive movement (todays prince – yesterdays price):
+Within PgStocked your data gets organised and prepared to data mine. The goal is not to simply store stupid eod data, the goal is to store anything! Since _anything_ is hard do declare the data structure have to be flexible enough to do so. Lets imagine the following situation: You are developing a trading strategy based on candle sticks. So all you need is simple stupid bar data (open, high, low, close, volume). But now you want to use your strategy only on companies with a gaining EBITDA. What can you do? With PgStocked you do not have to care about data structure just organise a feed (scrapper) for your needed data and feed it. On another day you hear about using tweets to predict stock prices. You think this would be interesting and you would like to give it a try. What can you do? Prototyping in Excel? No, just organise a feed and propagate it to your PgStocked.
+
+Once all the needed data is collected and stored, of course we want to do something cool with them :-) In PgStocked you can – as you could with PgNetted – use the Beanshell scripting engine. At this time an easy access to a Talib implementation is available too. Now with Java an Talib we can do pretty nice things like for example calculating am simple 20 day moving average over the prive movement (todays prince – yesterdays price):
 
 ~~~~~~
 set client_encoding to 'WIN1252';
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 11:33:30 -0000</pubDate><guid>https://sourceforge.netf2520702611fd0e95f8241b9a21e3d363c59c2ba</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v11 
+++ v12 
@@ -1,8 +1,8 @@
 PgBsh, PgNetted, PgStocked
 ====
-PgStocked is Quote and Static Data server for financial instruments written in [Postgres](http://www.postgresql.org/) PLSQL, [PLJava](http://pgfoundry.org/projects/pljava/)  and Java. PgStocked consists of three modules:
+PgStocked is Quote and Static Data server for financial instruments written in [Postgres PLSQL](http://www.postgresql.org/), [PLJava](http://pgfoundry.org/projects/pljava/) and Java. PgStocked consists of three modules:
 
-1. PgBsh: a scripting engine for Java Code, based on[BeanShell2]( http://code.google.com/p/beanshell2/)
+1. PgBsh: a scripting engine for Java code, based on [BeanShell2]( http://code.google.com/p/beanshell2/)
 
 2. PgNetted: a fully featured web scrapper with scheduler and async process queues, based on [HtmlUnit](http://htmlunit.sourceforge.net/) and [PgAgent]( http://www.postgresql.org/ftp/pgadmin3/release/pgagent/)
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 11:27:38 -0000</pubDate><guid>https://sourceforge.netaae58c718751b03a9ffa49a7c4208c45ea94bfdd</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v10 
+++ v11 
@@ -131,6 +131,6 @@
 
 And this is what you get
 ----
-Until now you only have an all-in-one solution or a very spread one. The disadvantage on the first one is that you can only use the data supported by your application. And the harm on the second is that you have to glue a lot. Everybody knows this situation: You want to download quote data with a simple tool like wget. Using finance.yahoo.com and cron this is no big deal . But soon you will discover that a quote for a single day is missing and the imagination of other days missing drives you crazy. So you start do adapt your downloading script. Now your script looks in your database first for the last available quote and uses this date as a parameter for your downloading script. A few months later you will be ended up in gluing scripts in various languages to do a rather simple job.
+Until now you only have an tranding tool onyl solution or a very spread one. The disadvantage on the first one is that you can only use the data supported by your application. And the harm on the second is that you have to glue a lot. Everybody knows this situation: You want to download quote data with a simple tool like wget. Using finance.yahoo.com and cron this is no big deal . But soon you will discover that a quote for a single day is missing and the imagination of other days missing drives you crazy. So you start do adapt your downloading script. Now your script looks in your database first for the last available quote and uses this date as a parameter for your downloading script. A few months later you will be ended up in gluing scripts in various languages to do a rather simple job.
 
 You get a modular and all in one place solution. You do not need to glue database, shell scripts and cron tasks anymore. To move your code simply dump your database and restore it, you are done, no need to care about missing libs or scripts and binaries or scheduling jobs. Develop on Windows and run on Linux without any cross compile issue. Develop nearly any index you want to, even index based once like valuing  tweets. Access your data through a web browser from and for any application you like.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 09:34:34 -0000</pubDate><guid>https://sourceforge.net164c662730773629647a09cff3a165826d85f88a</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 09:32:25 -0000</pubDate><guid>https://sourceforge.net79f856b10d11323b2126c3e64df905677d33fbc3</guid></item><item><title>WikiPage Home modified by Christian</title><link>https://sourceforge.net/p/pgnetted/wiki/Home/</link><description>&lt;pre&gt;--- v8 
+++ v9 
@@ -126,7 +126,7 @@
 
 To get to the data from any other application PgStock implements a very, very small web server. The server directly accesses special granted functions in the database instead of doing anything on the file system.
 
-[[img src= pgstocked_browser.jpg]]
+[[img src=pgstocked_browser.jpg]]
 
 
 And this is what you get
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Wed, 12 Oct 2011 09:31:23 -0000</pubDate><guid>https://sourceforge.net93486a8c41f0a17b1688c88b12194b1705cfa46e</guid></item></channel></rss>