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 :

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        108 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        55 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        37 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        38 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        75 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X