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

Ninjatrader start working slowly after connect through NtDirect.dll

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

    Ninjatrader start working slowly after connect through NtDirect.dll

    Hello there.

    I have java program (base on Spring Boot) that loads NtDirect.dll and connect to Ninjatrader through DllInterface. This communication work fine.

    I've created simple strategy that:
    1. Cancel all previous orders
    2. Sends 10 buy limit orders after each bar close with fixed price gap between.
    For example - if bar was closed on price 30.00, java sends 10 orders - 29.99, 29.98, 29.97...

    There are ATM strategy with TP and SL 2 pips and local OCO simulation.

    First 20-30 minutes everything works fine. Orders executes very fast. But after 30-40 minutes Ninjatrader start working very slow.

    And when I stop my java program (respectively communication through dllInterface stops) - Ninjatrader start working as fast as at beginning.

    Why Ninjatrader stucks after 30-40 minutes?

    If you need any additional info - please let me know.
    I can record a video session to reproduce this scenarios.

    Thank you!

    #2
    Hello romulko,

    Thank you for writing in.

    Can you please provide a video demonstrating this? Do you see any errors appearing in your log? What is NinjaTrader's CPU usage in the Windows Task Manager when the platforms starts to work "very slow"?
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Few words about java-client:

      1. I load NtDirect into java like this:

      Monosnap screenshot tool for Mac and PC with own cloud storage. Take screenshots, record videos and upload files directly to the cloud. Just in one click.


      2. Then I create a command and send it to the NinjaTrader through NtDirect like this:

      Monosnap screenshot tool for Mac and PC with own cloud storage. Take screenshots, record videos and upload files directly to the cloud. Just in one click.


      Each command has next values (of course - action, stopPrice, orderId are different for each command):

      command - PLACE
      account - SIM101
      instrument - CL 04-16
action - BUY
      qty - 1
      orderType - STOP
      limitPrice - 0
stopPrice - 33.87
      TIF - DAY
      ocoId -
      orderId - 91906F… (I generate it by calling dllInterface.NewOrderId())
      strategy - atm
      
strategyId -

      Monosnap screenshot tool for Mac and PC with own cloud storage. Take screenshots, record videos and upload files directly to the cloud. Just in one click.


      3. I create additional thread in the java client with sleep interval for 1 second to determine of accepted order status by calling dllInterface.OrderStatus.

      For example, if we have 10 pending orders dllInterface.OrderStatus function will be called 10 times per one second to determine order status.

      That it. I think all these actions should not affect on NinjaTrader and should not make it very slow.

      -------------

      Here's the video session:
      Join the web’s most supportive community of creators and get high-quality tools for hosting, sharing, and streaming videos in gorgeous HD with no ads.

      password - ninjatrader

      You can download this video with hight quality here:


      At the beginning NT process orders very fast. But after 15 minutes - CPU usage go up and windows of NT doesn't respond.

      But what interesting - when I stop my java-client (26:23 time of the video) - everything with NT starts working fine.

      Can you please give me any suggestion what to do? Thank you for your time.
      Last edited by romulko; 02-18-2016, 10:54 AM.

      Comment


        #4
        Hello Zachary.
        Maybe do you have any updates about this?

        I can write a simple java spring-boot program that will demonstrate this issue, if this will help you. You'll be able to test it on your machine and take a look at the source code of java client.
        Last edited by romulko; 02-22-2016, 02:00 PM.

        Comment


          #5
          Hello romulko,

          Support for using the NTDirect.dll is very limited.
          I will not be able to accept or test your code created outside of the NinjaTrader Platform.
          If you do have questions about the usage of the methods available I can assist with this.

          Below is a link where using the NTDirect.dll and NinjaTrader.Client.dll is discussed among community members. Post #24 in this thread is an example application.
          http://ninjatrader.com/support/forum...ead.php?t=6971
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Today, 12:02 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by GLFX005, Today, 03:23 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by nandhumca, Yesterday, 03:41 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Working...
          X