Forum

Free Download More Info
Welcome to the Personal Stock Streamer Developers Forum. Anyone can read messages, but you must be a registered user in order to post. (Sorry, we did this in order to prevent forum spam.)

Everyone who is registered for the Developers Forum on this site should now also have permission to log in and post to the Support Forum.  This was done by hand, so we may have missed a couple of people.  Please let us know if you do not have access to both forums.
Subscribe to RSS Feed
PSS Developers Forum -> Getting Ticker updates from PSS asynchronously in Visual Basic
Not logged in.
2009-01-06 18:09:28
1 of 1
#1313
I was chatting with a user in the CollabInvest developers chatroom yesterday and he was asking about getting ticker (quote) updates into a PnF charting application he had written.

See:

http://personalstockstreamer.com/support/forum.html?thr...

Here's a snipped of code:

' get connection to PSS
    
    Set PSSObject = GetObject(, "PSSScript.PSSScriptModule")
    Set PSSApp = PSSObject.Application
    
    ' get the EventManager class which will notify us when events happen
    
    Set PSSEventManager = PSSApp.GetObject("EventManager")
        
    ' tell the event manager to call the OnTickerUpdated method in this
    ' object for each tick on any ticker that comes in.
    ' note that this callback can happen up to once a second so it should
    ' run quickly.
    ' replace frmMain with whatever top level object in your application,
    ' in my test case it was frmMain. Add the OnTickerUpdated() method
    ' to the same class.
    
    PSSEventManager.RegisterHandlerMethod frmMain, "OnTickerUpdated"
    
End Sub

' this is the method that gets called on each update for each ticker,
' so this method will get called /alot/.
' A Ticker object is passed containing all the fields.

Public Function onTickerUpdated(ticker)
    Debug.Print "Ticker Update"
    Debug.Print " Symbol: " + ticker.GetProperty("Symbol")
    Debug.Print " Price: " + CStr(ticker.GetProperty("Price"))
End Function


 

----------------------
DTLink Software
----------------------
DTLink Software
Posted by: Yermo