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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    582 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    338 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X