Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No Status returned when some orders are cancelled

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

    #16
    i have just come up with a solution. straight after order is placed i set a variable called Order_Status to a string called "initialized". then at the top of my EL or EFS code I put in a line of code that says: if OrderStatus() == "pending submit" or OrderStatus()=="accepted" or OrderStatus()=="working" or OrderStatus()=="rejected" or OrderStatus()=="part filled" or OrderStatus()=="filled" then Order_Status=OrderStatus();

    then the next line of code says: if Order_State == "" or Order_State=="filled" or Order_State=="part filled" or Order_State=="rejected" then
    {
    if NTmarketPosition=0 and buy condition 1 = true then
    {
    Buy 1 contract at market;
    Order_State = "initialized";
    }
    }

    this gets around the problem that the NT function OrderStatus() does not return a string called "initialized" straight after an order is generated by e-signal or tradestation strategy code. once we know that an order has been filled, partfilled or rejected (or that no order exists ie empty string for Order_Status) we can then safely check NTmarketPosition to see what our position is at broker.

    hope this can help Moscu in some way, or any one else.

    good trading!

    Rocket ^

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    117 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    166 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    85 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  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    88 views
    0 likes
    Last Post PaulMohn  
    Working...
    X