Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

External Data Feed on Delphi or CBuilder

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

    External Data Feed on Delphi or CBuilder

    Hi,

    I am doing a custom data feed for NT writing code on C++ (Embarcadero CBuilder). I can connect to NTDirect.DLL, can call Last or Ask or LastPlayback function, but no data go to NT. What I do wrong? Below is a code sample and setting in NT:

    1. NT setting: new symbol "RTEST" as stock with external mapping "RTEST"
    2. Connected to External Data Feed
    3. AT Interface in File menu is checked
    4. The code on C++ and Delphi (both don't work):

    Header file:
    typedef int (*NTDirectAskPlayback)(wchar_t *instrument, double price, int size, wchar_t *timestamp);
    typedef int (*NTDirectAsk)(wchar_t *instrument, double price, int size);

    extern NTDirectConnected Connected;
    extern NTDirectAskPlayback AskPlayback;
    extern NTDirectAsk Ask;

    cpp file(some functions was omitted)
    bool LoadDLLs()
    {
    UnicodeString NTDirectName="NTDirect.dll";
    HINSTANCE h_NTDirect;

    h_NTDirect=LoadLib(NTDirectName.c_str());
    Connected=(NTDirectConnected)GetProcAddr(h_NTDirec t, "Connected");
    AskPlayback=(NTDirectAskPlayback)GetProcAddr(h_NTD irect, "AskPlayback");
    Ask=(NTDirectAsk)GetProcAddr(h_NTDirect, "Ask");
    }

    void __fastcall TForm1::Button3Click(TObject *Sender)
    {
    int r;
    UnicodeString Ticker="RTEST";
    UnicodeString Time="20110119100000";

    r=Connected(1);
    r=Ask(Ticker.w_str(),Price,Volume);
    r=AskPlayback(Ticker.w_str(),192080,24,Time.w_str( ));
    // r is 0, so function call is success
    }

    or in Delphi:

    Function LastPlayback( Symbol: string; Price: Double; Size: Integer; Timestamp: string ): integer; stdcall; external 'NtDirect.dll';
    Function Last( Symbol: ShortString; Price: Double; Size: Integer ): integer; stdcall; external 'NtDirect.dll';

    procedure TForm1.Button1Click(Sender: TObject);
    var r:integer;
    begin
    r:=LastPlayback('RTEST',192080,34,'20110120100010' );
    r:=Last('RTEST',192080,34);
    // r is 0, so function call is success
    end;

    #2
    Hello mv_trader,

    Welcome to the NinjaTrader forums!

    Unfortunately our support for this is limited. We can help you verify the setup within the NinjaTrader application. You have everything squared away with the mapping, connections, and AT interface.

    Use the control center, orders tab, to verify that you are getting data instead of the charts. Consider trying bid or last in addition to ask. See if you can get other types of account data.

    Hopefully other community members can look at your code and offer additional input.
    Last edited by NinjaTrader_RyanM1; 01-20-2011, 10:06 AM.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X