Announcement

Collapse
No announcement yet.

system call failed error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • system call failed error

    Hi,

    I have a VB program requesting quotes for 1000 stocks in a loop.

    esignal.RequestSymbol sSymbol, False

    I gave 10 miliseconds in between each request (just to give some time before i got the data)

    1000 X 10 miliseconds = 10 seconds!!!

    After 10 seconds, I start collection the data with
    quote = esignal.GetBasicQuote(sSymbol)

    I got the following Visual Basic Error with the request line (above) in the code is highlightened. There is an error with this line!!

    Run-Time Error
    Automation Error
    System Call failed

    I suspect, my password limits to 200 simultanous requests. And I am requesting more.

    But, I don't know how to solve it!! please help me.

    PS: Program is attached!
    Thanks - Umit

    ####################################

    Dim WithEvents esignal As IESignal.Hooks



    Private Sub RequestSymbol(sSymbol As String)

    sLastSymbol = sSymbol
    esignal.RequestSymbol sSymbol, False

    End Sub


    Private Sub cmdRequestSymbols_Click()

    cmdStop.Caption = "Stop"


    For I = 1 To 30000

    RequestSymbols
    DoEvents
    'lstHistory.AddItem I
    Sleep (10000)
    If (cmdStop.Caption = "Trying to Stop") Then
    cmdStop.Caption = "Stopped!!"
    Exit For


    End If


    Next I

    End Sub


    Private Sub RequestSymbols()
    Dim quote As IESignal.BasicQuote
    Dim strSymbol As String
    Dim dblCLose As Double
    Dim dblLast As Double


    cmdRequestSymbols.Caption = "Running"

    cmdRequestSymbols.Caption = "Request Started"


    Open ".\symbols_in.txt" For Input As #1


    Do Until (EOF(1) = True)

    Input #1, strSymbol, dblCLose
    Trim (strSymbol)
    RequestSymbol strSymbol
    Sleep (30)


    Loop
    Close 1

    cmdRequestSymbols.Caption = "Request Ended"

    'Sleep (1000)

    quote = esignal.GetBasicQuote(strSymbol)
    dblLast = Str$(quote.dLast)



    cmdRequestSymbols.Caption = "Download Started"
    GetSymbols
    cmdRequestSymbols.Caption = "Download Ended"




    End Sub

    Private Sub GetSymbols()

    Dim quote As IESignal.BasicQuote
    Dim dblCLose As Double
    Dim strSymbol As String
    Dim dblDeltaClose As Double
    Dim dblLast As Double
    Dim strMsg1 As String
    Dim strHeader1 As String
    Dim strHeader2 As String
    Dim dblDelta As Double
    Dim sngMaxArray(21) As Single
    Dim strMaxLineArray(21) As String
    Dim intMaxCounter As Integer
    Dim sngMaxIndex As Integer
    Dim sngDeltaClose As Single



    intMaxCounter = 0




    dblDelta = -1 * (txtDeltaPercent.Text / 100)


    Open ".\symbols_in.txt" For Input As #2


    lstHistory.Clear

    strHeader1 = "SYMB" & vbTab & "LAST" & vbTab & "DELTA %"
    lstHistory.AddItem strHeader1
    strHeader2 = "******" & vbTab & "******" & vbTab & "************"
    lstHistory.AddItem strHeader2



    'Beep
    Do Until (EOF(2) = True)
    Input #2, strSymbol, dblCLose

    'Sleep (10)
    quote = esignal.GetBasicQuote(strSymbol)

    dblLast = Str$(quote.dLast)
    dblDeltaClose = (dblLast - dblCLose) / dblCLose
    sngDeltaClose = 100 * dblDeltaClose


    If (dblDeltaClose < dblDelta) And (dblLast <> 0) Then
    If (dblDeltaClose < 0.9) Then
    Beep
    Sleep (1000)
    Beep
    Sleep (1000)
    Beep
    Sleep (1000)
    End If
    strMsg1 = strSymbol & vbTab & dblLast & vbTab & sngDeltaClose & "%"
    intMaxCounter = intMaxCounter + 1
    strMaxLineArray(intMaxCounter) = strMsg1
    sngMaxArray(intMaxCounter) = dblDeltaClose


    End If
    Loop
    Close 2



    For M = 1 To 20

    sngMax = 1
    For I = 1 To 20
    If sngMaxArray(I) < sngMax Then
    sngMax = sngMaxArray(I)
    sngMaxIndex = I
    End If
    Next I

    If (sngMaxArray(sngMaxIndex) <> 0) And (sngMaxArray(sngMaxIndex) <> 1) Then
    lstHistory.AddItem strMaxLineArray(sngMaxIndex)


    End If
    sngMaxArray(sngMaxIndex) = 1

    Next M



    End Sub


    Private Sub cmdStop_Click()
    cmdStop.Caption = "Trying to Stop"
    cmdRequestSymbols.Caption = "Request Symbols"


    End Sub

    Private Sub Form_Load()
    Set esignal = New IESignal.Hooks

    esignal.SetApplication ("tuzel")



    End Sub

    Private Sub Form_Unload(Cancel As Integer)

    Set esignal = Nothing
    End Sub

  • #2
    I haven't tried your program, but if you really are trying to receive 1000 symbols when your account is set for a max of 200, then there would definitely be a problem. If you really need that many simultaneously, I believe you can add that option to your account via the Account Maintenance web page (for an additional monthly fee of course).

    Cheers... George

    Comment

    Working...
    X