Jump to content

Working With Functions


Recommended Posts

Okay I am new to functions and have very little experience with them.

What I want is to have it where I define a variable called stock symbol and then it will use the function pulldata and pull all of the information as the two array

 

 
#include <IE.au3>
#include <array.au3>
#Include <File.au3>
#include <string.au3>
#include <INet.au3>
 
Global $StockSymbol = InputBox("Stock Symbol", "Enter stock symbol");
 
Func PullData()
$x = 0;This keeps track of the loop for Stock One
 
$BloombergDataDirty = _INetGetSource('http://www.bloomberg.com/quote/' & $StockSymbol & ':US');Pulls bloombergs data
InetClose ($BloombergDataDirty);Closes the connection to bloomberg
 
$BloombergData = _StringBetween($BloombergDataDirty, '"data_values":[', '],"');This seperates the data set
 
$BloombergDataSet = _StringBetween($BloombergData[0], '[', ']');
 
$totalcount = Ubound($BloombergDataSet);
 
Local $StockOneTime[1];
Local $StockOnePrice[1];
 
Do
 
   $Finished = StringSplit($BloombergDataSet[$x], ',');
   _ArrayAdd($StockOneTime, $Finished[1]);
   _ArrayAdd($StockOnePrice, $Finished[2]);
 
   $x = $x + 1;
 
Until $x = $totalcount
EndFunc
 
_ArrayDisplay($StockOneTime);
_ArrayDisplay($StockOnePrice);
 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...