aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/network/stoxpred.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-05-27 18:43:20 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-05-27 18:43:20 +0300
commit29f1563294ac1ab19aa252f3fd5fca94c4f88516 (patch)
tree1acfaad5610df7af96bd9a2ddce1eb3d8b9304e9 /awklib/eg/network/stoxpred.awk
parent58cc32a6d4a179b3005f8e4fecbff932da681fba (diff)
downloadegawk-29f1563294ac1ab19aa252f3fd5fca94c4f88516.tar.gz
egawk-29f1563294ac1ab19aa252f3fd5fca94c4f88516.tar.bz2
egawk-29f1563294ac1ab19aa252f3fd5fca94c4f88516.zip
Bug fix to extract.awk. Rerun and update files.
Diffstat (limited to 'awklib/eg/network/stoxpred.awk')
-rw-r--r--awklib/eg/network/stoxpred.awk29
1 files changed, 29 insertions, 0 deletions
diff --git a/awklib/eg/network/stoxpred.awk b/awklib/eg/network/stoxpred.awk
index 62744c14..aa1fbe9f 100644
--- a/awklib/eg/network/stoxpred.awk
+++ b/awklib/eg/network/stoxpred.awk
@@ -1,3 +1,32 @@
+BEGIN {
+ Init()
+ ReadQuotes()
+ CleanUp()
+ Prediction()
+ Report()
+ SendMail()
+}
+function Init() {
+ if (ARGC != 1) {
+ print "STOXPRED - daily stock share prediction"
+ print "IN:\n no parameters, nothing on stdin"
+ print "PARAM:\n -v Proxy=MyProxy -v ProxyPort=80"
+ print "OUT:\n commented predictions as email"
+ print "JK 09.10.2000"
+ exit
+ }
+ # Remember ticker symbols from Dow Jones Industrial Index
+ StockCount = split("AA GE JNJ MSFT AXP GM JPM PG BA HD KO \
+ SBC C HON MCD T CAT HWP MMM UTX DD IBM MO WMT DIS INTC \
+ MRK XOM EK IP", name);
+ # Remember the current date as the end of the time series
+ day = strftime("%d")
+ month = strftime("%m")
+ year = strftime("%Y")
+ if (Proxy == "") Proxy = "chart.yahoo.com"
+ if (ProxyPort == 0) ProxyPort = 80
+ YahooData = "/inet/tcp/0/" Proxy "/" ProxyPort
+}
function ReadQuotes() {
# Retrieve historical data for each ticker symbol
FS = ","