Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to detect naked positions

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

    How to detect naked positions

    Hello guys,

    Now Im aware that I can use Position.MarketPosition to know if my strategy is flat, long or short.

    How can I detect when I have a naked position? Meaning that Im short or long, but I dont have active exit orders... no stop, no target.

    Thank you!

    #2
    Hello facuevasm,

    That would generally involve using logic of your own to know that. If your strategy submits an order and it fills that will enter into a position however there are no specific events to signal that no targets were submitted.

    If you want to know for sure if there are targets active or working you could use order objects. We have a sample that shows finding a stoploss order, the same type of logic could be used to monitor or know if any target is working. If the object is null you would know there is not currently an order so you could do the logic to put targets up. The order events like OnOrderUpdate or OnExecutionUpdate can be used to monitor the orders once they are submitted or store them to variables to make the variable not null (the order now exists).



    the above sample uses a list to collect orders, that is not necessarily a great way to see how the orders can be used. I would also suggest looking at how this sample uses its Order variables in its logic: https://ninjatrader.com/support/help...and_onexec.htm


    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
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X