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 00nevest, Today, 02:27 PM
    0 responses
    1 view
    0 likes
    Last Post 00nevest  
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    9 views
    0 likes
    Last Post futtrader  
    Working...
    X