Jump to content

Stock Tracker


llewxam
 Share

Recommended Posts

My girlfriend was dissatisfied with our online stock broker, you can not see the current stock price and the price you bought it at the same time, so I quickly whipped this up to bridge that gap. It is lacking a listview sort feature because I would then have to sort the array that contains all of the data to be the same, and just didn't want to bother. It is at least a good example and a platform to work off of if anyone wants to take it further, works perfectly well for our needs though.

When you add a watch it is not permanently saved, but when you specify a buy that gets saved in an INI file so anything you own stock in will be reloaded the next time the script is run. The only annoyance I have at the moment is with the UNC times - I specified the UNC times for market open and close of NYSE and NASDAQ but it was claiming the market was still open close to 5PM, so obviously something is off there. I worked in a daylight savings time hack that I think is what the cause was, but would like to know if people not in the Eastern time zone are not getting proper updates during market hours. Maybe my fix wasn't the right fix.......

Due to my work schedule I have never gotten the chance to see it working during trading hours, kinda annoying but oh-well :) Enjoy, and hopefully your stocks do better than ours are!!! :D

Ian

Updated 10/30/12 - thanks to careca and boththose for the bug report. Previous build downloaded 24 times.

Stock Tracker.zip

Edited by llewxam

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

hi, win7 x64

C:Users7DesktopStock Tracker.au3 (308) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$sBreakTitleQuote = StringSplit($sBreakCNEX[2], "title=" & Chr(34), 1)

$sBreakTitleQuote = StringSplit(^ ERROR

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

I also use Win7 x64 and it is working fine for me. I was getting that same message a lot until I added the second split method, so maybe just try it again, there may have been some sort of data loss on the INetGet.

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

C:Users7DesktopStock Tracker.au3 (308) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$sBreakTitleQuote = StringSplit($sBreakCNEX[2], "title=" & Chr(34), 1)

$sBreakTitleQuote = StringSplit(^ ERROR

its showing this error for me when i put stock name wrong

GOOG => Google Inc.

GOG => error

Link to comment
Share on other sites

its showing this error for me when i put stock name wrong

GOOG => Google Inc.

GOG => error

Did I forget to deal with that??? OOPS!! I really just threw it up on the forum as-is, didn't spend much time bullet-proofing it......

Thanks for the heads-up, I will check on it later when I get home.

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

Yes, that was it, name was wrong, it doesn't give any error in msgbox, just closes with that error, in output console.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

nice script.

since the check for $parsed <> 1 is present after each call, having _parse() return 1 if the array is empty seemed the easiest way to eliminate the error.

modified parse function:

Func _Parse($sSymbol)
If $sSymbol Then
$StockData = _INetGetSource("http://investing.money.msn.com/investments/stock-price?Symbol=" & $sSymbol)
;~ msgbox(0, '' , $StockData)
If @error <> 0 Then
MsgBox(16, "Uh Oh", "No data found, waiting until next refresh.", 5)
Return SetError(1)
Else
If StringInStr($StockData, "Information on <b>" & $sSymbol & "</b> is not available") Then
MsgBox(16, "Uh Oh", "That symbol is invalid, please try again.")
Return SetError(1)
Else
$sBreakCNEX = StringSplit($StockData, "<div class=" & Chr(34) & "cnex" & Chr(34) & ">", 1)
If $sBreakCNEX[0] > 1 Then
$sBreakTitleQuote = StringSplit($sBreakCNEX[2], "title=" & Chr(34), 1)
$sBreakName = StringSplit($sBreakTitleQuote[2], Chr(34) & ">", 1)
$sCompany = $sBreakName[1]
$sBreak1 = StringSplit($StockData, "$.quotebroker.setTitleProperties($dataItem, 'Last')" & Chr(34) & ">", 1)
If $sBreak1[0] == 1 Then $sBreak1 = StringSplit($StockData, "<span class=" & Chr(34) & "lp" & Chr(34) & ">", 1)
$sBreakPrice = StringSplit($sBreak1[2], "</span>", 1)
$sPrice = $sBreakPrice[1]
Return $sCompany & Chr(2) & $sPrice
Else
Return 1
Endif
EndIf
EndIf
EndIf
EndFunc ;==>_Parse
Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Interesting hack boththose :) I'm not at home yet so still haven't run it, but I like the concept.

Thanks!

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

Well, looks like I did try to avoid that kind of thing but either I was smokin the crack and used a different financial site during that build or MSN changed the wording in their source when a symbol didn't exist. So, I took boththose's suggestion about the "Return 1" on fail but also re-arranged a couple things to try and improve the situation.

Thanks careca and boththose!

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
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...