Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to check if a position exists?

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

    How to check if a position exists?

    Hi,
    for crying out load I can't find any information how to check if a position has been entered and is still active. I enter a postition with
    EnterLong(
    1,"Entry"+i);
    and later want to check if a specific position - for instance Entry1 in this case - is open and has not been stopped out. Currently I'm resetting stop levels and getting lots of 'This was an exit order but no position exists to exit' messages which makes me feel rather stupid...
    Thanks for some guidance!


    #2
    Gwaihir, you would be using the Position object for those checks :



    For a specific order state check, the IOrder objects would be needed for finer control / reporting :

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you for the fast reply. I did look at those but I couldn't figure out how they might help with my problem so some more information from you will be much appreciated. If I check the position I can't trace the status of a single entry. For instance Entry1 might be stopped out but Entry2 is still active so the position is long. With the IOrder object I can see that that order has been filled but how do I see whether the related position is still in existance?

      Comment


        #4
        You would to check the IOrders for your stops and if the stop IOrder FromEntrySignal X filled, then you know the position is stopped for example.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:00 AM
        0 responses
        1 view
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        3 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Started by samish18, Yesterday, 08:31 AM
        2 responses
        9 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by Mestor, 03-10-2023, 01:50 AM
        16 responses
        391 views
        0 likes
        Last Post z.franck  
        Working...
        X