Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling MarketData from DLL freezes Tradestation

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

    Calling MarketData from DLL freezes Tradestation

    I have create an study in tradestation that would plot the bid/ask from the connected data feed. I wrapped the following DLL symbols into TS functions:

    SubscribeMarketData
    UnsubscribeMarketData
    MarketData
    My indicator calls SubscribeMarketData then it calls the wrapper for MaketData passing the 0,1,2 for bid/ask/last.

    As soon as I load the indicator the whole tradestation freezes and I have to restart. I know the problem is in marketdata because when I comment/uncomment the problem shows/disappear.

    My MaketData is as follows:


    DefineDLLFunc: "NtDirect.dll", int, "MarketData", lpstr, double;
    inputs: PriceType(numericsimple);
    NTMarketData = MarketData(GetSymbolName, PriceType);


    Thanks,

    Moscu

    #2
    Incorrect declaration. Try
    DefineDLLFunc: "NtDirect.dll", int, "MarketData", lpstr, int;

    Where did you find the wrong one?

    Comment


      #3
      That did it

      Dierk,

      Thanks that help, but the return was also wrong so here is the correct version:

      DefineDLLFunc: "NtDirect.dll", double, "MarketData", lpstr, int;
      inputs: PriceType(numericsimple);
      NTMarketData = MarketData(GetSymbolName, PriceType);

      I think NT should wrap all this functions by default instead of the user having to do this.


      Moscu

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X