Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 popecapllc, 08-09-2023, 07:42 PM
    8 responses
    1,350 views
    0 likes
    Last Post Johng22
    by Johng22
     
    Started by ETFVoyageur, 04-30-2024, 02:04 PM
    11 responses
    101 views
    0 likes
    Last Post ETFVoyageur  
    Started by bubblegum, 03-18-2024, 10:41 AM
    3 responses
    46 views
    0 likes
    Last Post vjsworld  
    Started by JamesK1, Today, 02:48 PM
    1 response
    13 views
    0 likes
    Last Post JamesK1
    by JamesK1
     
    Started by llanqui, Today, 03:51 PM
    0 responses
    13 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Working...
    X