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

Accessing NT position information from outside NT

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

    Accessing NT position information from outside NT

    Hi,

    I'm trying to write a plug-in that would allow my client to access some of his positions from outside NT. Essentially I'm looking for a kill-switch that would close all positions and cancel all working/pending orders, but need to do it from an independent UI. The client may be satisfied with having this UI available from within NT, however his requirements are to have a separate pop-up that would allow for this kill-switch.

    How can I make this happen (generally speaking)?

    thanks!

    #2
    Welcome to our forums HappyDev, you can take a look at the functions our AT interface would offer here - http://www.ninjatrader.com/support/h...ed_trading.htm

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      Thanks for the information. I imagine there is no problem using the DLL functions from within a Visual Studio.NET application, correct?

      thanks!

      Originally posted by NinjaTrader_Bertrand View Post
      Welcome to our forums HappyDev, you can take a look at the functions our AT interface would offer here - http://www.ninjatrader.com/support/h...ed_trading.htm

      http://www.ninjatrader.com/support/h...parameters.htm

      Comment


        #4
        Though not officially supported that should work - other customers for example have also found success adding a reference to the NinjaTrader Client dll in their C# project.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand,

          Thanks for the information. I do have another question regarding the DLL functions. I need to be aware of the account status. For example one requirement is to exit all trades when a certain number of PIPs/Ticks are made, therefore I'll need access to the unrealizedPnL.

          Currently in NinjaScript I can use a call like this:

          Position.GetProfitLoss(Close[0], PerformanceUnit.Currency)

          but how can I query NT for this information via the DLL interface?

          thanks!



          Originally posted by NinjaTrader_Bertrand View Post
          Though not officially supported that should work - other customers for example have also found success adding a reference to the NinjaTrader Client dll in their C# project.

          Comment


            #6
            There's unfortunately only a RealizedPnL function on the account level accessible here, you would need to monitor the specific open position PnL in your custom code (you can access the fill price for your order id though).
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,266 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X