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

Does NTMarketPosition() work on IB FA accounts?

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

    Does NTMarketPosition() work on IB FA accounts?

    If via TradeStation 9.1 Easy-Language code (using NT8 DLL method) we place a limit order to buy 100 gold contracts in an IB FA master account and only 50% of the working order gets filled, if in TS EL code we call the NTMarketPosition(Gold,"MasterAccount#") function in relation to the master account will calling this function return a value of 50?

    Also will calling NTOrderStatus() return a "PartFilled" string? Reason we ask is that if Ninja places orders into the IB FA master account we need to be able to monitor how much of the order actually gets filled and also be able to monitor the total market position for Gold in the master account, so then when we go to exit the position via ninja/TS we know exactly how many contracts to sell to exit the gold position completely. Is this possible?

    Thanks in advance. Regards, Rod.
    Last edited by Rocket130713; 03-01-2018, 08:39 AM.

    #2
    Hello Rocket130713,

    Thanks for opening the thread.

    If via TradeStation 9.1 Easy-Language code (using NT8 DLL method) we place a limit order to buy 100 gold contracts in an IB FA master account and only 50% of the working order gets filled, if in TS EL code we call the NTMarketPosition(Gold,"MasterAccount#") function in relation to the master account will calling this function return a value of 50?
    When an order is submitted to the master account, we will only see order feedback for Working/Accepted, Cancelled, or Rejected. The executions and positions are delegated to the sub accounts and we would not see the the executions or positions on the master account. I would not expect this to return a useful value when looking at the position on the master account.

    Also will calling NTOrderStatus() return a "PartFilled" string? Reason we ask is that if Ninja places orders into the IB FA master account we need to be able to monitor how much of the order actually gets filled and also be able to monitor the total market position for Gold in the master account, so then when we go to exit the position via ninja/TS we know exactly how many contracts to sell to exit the gold position completely. Is this possible?
    NTOrderStatus() will return any of the order state definitions listed in our help guide. Partial fills should be seen if they have occurred.

    Order State definitions - https://ninjatrader.com/support/help...efinitions.htm

    For additional consideration, NinjaScript strategies enabled on the master account will hit the same behavior using FA accounts where the executions and positions are delegated to the sub account and the strategy will not see Order/Position/Execution updates for the orders it submits. Additional programming to use Account level event handlers like we see in AddOns will need to be implemented into the strategy to manage the positions.

    Given the behavior discussed with position tracking with FA accounts, I may suggest looking into using NinjaScript strategies with the Account class event handlers over Easy Language and the DLL interface to accomplish your goal.

    Please see the AddOn Account class for information on implementing the event handlers for Order/Position/Execution updates - https://ninjatrader.com/support/help...ount_class.htm

    If there is anything else I can do to help, please let me know.
    Last edited by NinjaTrader_Jim; 03-01-2018, 09:25 AM.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kempotrader, Today, 08:56 AM
    0 responses
    6 views
    0 likes
    Last Post kempotrader  
    Started by kempotrader, Today, 08:54 AM
    0 responses
    4 views
    0 likes
    Last Post kempotrader  
    Started by mmenigma, Today, 08:54 AM
    0 responses
    2 views
    0 likes
    Last Post mmenigma  
    Started by halgo_boulder, Today, 08:44 AM
    0 responses
    1 view
    0 likes
    Last Post halgo_boulder  
    Started by drewski1980, Today, 08:24 AM
    0 responses
    3 views
    0 likes
    Last Post drewski1980  
    Working...
    X