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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    131 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X