Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy to close positions

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

    strategy to close positions

    Let's say I wanted to make a strategy that:

    1) monitors the account's open positions (note: positions are not created by the strategy)

    2) closes them based on some calculations the strategy makes

    Is this possible?

    Would it work on Rithmic accounts? what about CQG accounts?

    What if the position was created by another platform on the same rithmic or cqg account? :

    a) would it show up in ninjatrader?

    b) and could it be manipulated the way mentioned above?

    #2
    Hello NinjaCustomer,

    Thanks for the post.

    This is possible but you would not want to use a Strategy specifically for this type of use. The Addon account methods could be used from an indicator or addon to achieve this type of control over the accounts positions. A strategy is intended to be virtualized and trade for you, it is not a good candidate for also having control over the account directly as that could lead to actions that disable it.

    For external positions it would need to exist in the accounts position collection in the platform so this would be something which you would need to try and see if the position is reported in the positions collection. Generally you would need to submit all orders from NinjaTrader to have full control over the situation with NinjaScript. Another way to look at this would be if you can manage the position in the platform the addon methods should generally be able to see that to work with it.




    I look forward to being of further assistance.

    Comment


      #3
      ok so i can make an indicator? I prefer indicators because they let me easily edit inputs and also are easier to develop

      my "manage" do you mean that if i can manipulate these externally created positions through the UI then they should be available to the indicator?

      Comment


        #4
        Hello NinjaCustomer,

        That is correct, you could use the Account class and any of its methods/events from an indicator. The account class deals directly with the account instead of using the virtual values of a strategy.

        By manage I mean if you can see it in the control center positions tab to manage it, such as closing the position, then you should be able to access it in the positions collection from the account.


        If you wanted to give that a try without programming anything you could import the addon sample basic from the link here: https://ninjatrader.com/support/help...t_overview.htm
        After having a position, you could select the account in the addon window and then click "Account positions". If you see the position printed that means the addon account methods were able to see it and work with it.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        24 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        120 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X