Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ntDirect.dll Close a position

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

  • NinjaTrader_ChelseaB
    replied
    Hello Markus,

    I've received tracking ID# NTEIGHT-14090 for this behavior where an active Atm is not fully closed through the API with the CLOSESTRATEGY command.

    As new releases of NinjaTrader become available, please check the release notes for this ID.
    Once the ID is listed, please update and confirm the behavior is corrected.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Markus,

    I'm finding if the order is submitted by the external app, the Atm ID is returned but does not if the order is made within NT.

    Once I was retrieving the Atm ID I was able to produce behavior where the position, stop, and target are not closed, but the Active Atm is turned off.

    I've reported this behavior to our development. Once I have a tracking ID for this behavior I will post in this thread.

    Leave a comment:


  • mphilipp
    replied
    Hi Chelsea,

    yes.
    As I wrote in my first post, _ntClient.StrategyPosition(_uuid) gets the right position size of the current running strategy. But using this _uuid by CLOSESTRATEGY the retutn value of the command function is zero, which suggesting everthing is fine, but nothing happens....
    In the LOG tab the id is the same as I'm using and it should work, obviously there is an issue with this command.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Markus,

    My apologies, I focused on the wrong command when I went to the help guide.

    In trying to test the CLOSESTRATEGY command I'm finding there may be an issue with the Strategies() method that returns the list of IDs.

    If you Console.WriteLine() the string returned from Strategies() are you finding this is working on your end and properly returning the instance IDs?
    Last edited by NinjaTrader_ChelseaB; 10-10-2019, 09:39 AM.

    Leave a comment:


  • mphilipp
    replied
    Hello Chelsea,

    once again me...
    I tried the CLOSEPOSITION command, this works. How I get the fill price of the closing command? I have no idea how to get this value.

    Cheers
    Markus

    Leave a comment:


  • mphilipp
    replied
    Hello Chelsea,

    as you can see I like to close the position by CLOSESTRATEGY, this is because I opened this by a strategy.
    In the description you wrote, the only 2 parameters I need to fill is the command and the strategieId... this should work. If this is wrong then the description is confusing.

    When I'm using the CLOSEPOSITION command all the open positions are closed within the account and instrument.

    Or I'm wrong?

    Thx
    Markus

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Markus,

    Are you supplying the account name and instrument name?

    From the help guide:
    "CLOSEPOSITION COMMAND
    This command will close a position and requires an account name value and an instrument name value. The instrument name value is the name of the NinjaTrader instrument including the exchange name. For equities, the symbol is sufficient. This command will cancel any working orders and flatten the position."

    Leave a comment:


  • mphilipp
    started a topic ntDirect.dll Close a position

    ntDirect.dll Close a position

    Good Morning @all,

    I need a bit advice because I don't understand this issue:

    I placed an order via NTDirect.Dll, using a strategy. This works fine, but if I like to close this via the Command(CLOSESTRATEGY) the response is 0 (No Error) but in the Log Tab I see
    the following message:
    OIF, 'CLOSESTRATEGY;;;;0;;0;0;;;;;669ADE6DD50E4EC6BEDF5 B62A59235F5' unknown strategy
    using the following line of code:

    _ntClient.Command("CLOSESTRATEGY", null, null, null, 0, null, 0, 0, null, null, null, null, _ntClient.Strategies(_currentAccount));

    Very interessting at this point, using the same "unkown strategy" ID by _ntClient.StrategyPosition(_uuid) I receive the correct position size....

    Any suggestions?

    Thx for your advice
    Markus

Latest Posts

Collapse

Topics Statistics Last Post
Started by andrewtrades, Today, 04:57 PM
1 response
5 views
0 likes
Last Post NinjaTrader_Manfred  
Started by chbruno, Today, 04:10 PM
0 responses
3 views
0 likes
Last Post chbruno
by chbruno
 
Started by josh18955, 03-25-2023, 11:16 AM
6 responses
436 views
0 likes
Last Post Delerium  
Started by FAQtrader, Today, 03:35 PM
0 responses
7 views
0 likes
Last Post FAQtrader  
Started by rocketman7, Today, 09:41 AM
5 responses
19 views
0 likes
Last Post NinjaTrader_Jesse  
Working...
X