Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IB TWS API issue in a strategy

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

    IB TWS API issue in a strategy

    I am trying to call the IB TWS API from within a strategy, but keep NT keeps crashing with "Could not load file or assembly AxInterop.TWSlib" errors.

    I have correctly referenced the AxInterop.TWSlib and Interop.TWSlib DLLs and I am using the test code shown below.

    This works perfectly well in a C# form created by Visual Studio, but I'm at a loss why the NT strategy cannot load the AxInterop.TWSlib dll.

    The only thing that I can think of is that it might have been loaded already by NT.

    Can you shed any light on this please

    Thanks

    Code:
    #region Variables
            private AxTWSLib.AxTws Tws1; 
            #endregion
    
            /// <summary>
            /// This method is used to configure the strategy and is called once before any strategy method is called.
            /// </summary>
            protected override void Initialize()
            {            
                Tws1 = new AxTWSLib.AxTws();
                Tws1.reqHistoricalData(1, "MSFT", "STK", "", 0, "","", "smart", "usd",0, "20080124 11:01:00","3600 S", "5 mins","MIDPOINT", 1, 1);
                Tws1.historicalData+=new AxTWSLib._DTwsEvents_historicalDataEventHandler(this.historicalData); 
                
            }
    
            private void historicalData(object sender, AxTWSLib._DTwsEvents_historicalDataEvent e)
            {
                string msg = "Id="+e.reqId+" Date: "+e.date+" open: "+e.open+" high: "+e.high+" low: "+e.low+" close: "+e.close+" volume: "+e.volume;
                Print (msg);
            }
    Last edited by Operandi; 12-12-2008, 03:24 AM.

    #2
    Unfortunately this is beyond the scope of what we provide support for. May be the community wanted to contribute...

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X