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 CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        7 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        118 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        168 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        88 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        130 views
        0 likes
        Last Post cmoran13  
        Working...
        X