Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check if position has no stop loss or profit target?

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

    Check if position has no stop loss or profit target?

    Hello,

    My strategy sometimes results in some 'naked' positions - likely when price is moving too fast to keep up with the order entry. I am providing entry signals and am trying to update though, but the stop loss doesn't "show up" again once the system decides to cancel it.

    Is there a way to either:
    1. retroactively apply a stop loss on an open position.
    or
    2. simply detect that a position is open?

    Thanks!

    #2
    Hello, thanks for writing in. The strategy can check the Account.Orders collection to see how many orders are active on the account:


    Your strategy can check if there is an open position through the Position object:

    Comment


      #3
      Hi chris,

      Thanks for the reply. Unfortunately - both those links are dead. I'm familiar with both of those objects- the problem is that I'm seeing my orders placed in the log(i've got the trace on).

      What I'm interested in is how to make sure that - given a position based on entry signal "ABC" for example, can I get ahold of the stop loss/profit targets for position "ABC"?

      Thx!

      Comment


        #4
        Hi, the links are working for me. Try these:

        Code:
        https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?orders_account.htm
        https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?position.htm

        Comment


          #5
          Hi chris,

          As I said, I'm familiar with these two objects and actually did read the docs already. Can you answer my question? I'm already trying to place new stop loss orders based on the entry signal, but they're not doing anything. The position is still naked. Is there a way to programmatically check?

          Thanks!

          Comment


            #6
            Hi, Unfortunately, its not possible for a Strategy to manage a manually placed order because the manually placed orders do not generate any signal names. You would need to add a button to the strategy that will submit protective orders from within the managed strategy. We have an example of this attached.
            Attached Files

            Comment


              #7
              Hi Chris - thanks for this. Can you also add other widgets like textboxes, and handle mouse clicks on the chart? If so - can you point me to some samples?

              Thanks!

              Comment


                #8
                Hi, unfortunately, this is the only example that we have and it technically goes outside of the scope of support we can provide because this has more to deal with WPF modifications. We have a more complete example here:

                Comment


                  #9
                  Originally posted by -kman- View Post
                  Hi Chris - thanks for this. Can you also add other widgets like textboxes, and handle mouse clicks on the chart? If so - can you point me to some samples?

                  Thanks!
                  These can be created but you need to use the object like a part of a function.
                  I create a button, a button shows if it has been clicked and then allows the next on chart mouse down to effect logic to handle the events connected to the button. The button is to understand when to create the function and execute logic only when the function is to be generated.
                  I have a set that show a price if the chart is clicked and then the button it reset.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  602 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  347 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  559 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  559 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X