Couldn't connect to TWS



  • Hi!
    When i tried ibtest.py and my input was(nothing changed )

    --data0 EUR.USD-CASH-IDEALPRO  --timeframe Seconds --compression 1
    

    and i got

    \ibtest>python ibtest.py --data0 EUR.USD-CASH-IDEALPRO --resample --timeframe Seconds --compression 1
    --------------------------------------------------
    Strategy Created
    --------------------------------------------------
    Datetime, Open, High, Low, Close, Volume, OpenInterest, SMA
    ***** STORE NOTIF: <error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.>
    ***** STORE NOTIF: <error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.>
    ***** STORE NOTIF: <error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.>
    ***** STORE NOTIF: <error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.>
    

    Do you meet the same problem ? how to fix it ?
    Thanks in advance


  • administrators

    Sorry, but the information is not enough.

    • Is TWS running?
    • If yes on which port?
    • Have you specified the same port for the sample?
    • Have you (as pointed out in the error message) checked the error message?

      Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.