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 Torontobluejays, Today, 08:43 AM
        0 responses
        1 view
        0 likes
        Last Post Torontobluejays  
        Started by sastrades, 01-31-2024, 10:19 PM
        12 responses
        186 views
        0 likes
        Last Post sastrades  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        8 responses
        863 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by giulyko00, 04-24-2024, 12:03 PM
        6 responses
        29 views
        0 likes
        Last Post giulyko00  
        Started by 00nevest, 04-27-2024, 02:27 PM
        3 responses
        27 views
        0 likes
        Last Post 00nevest  
        Working...
        X