Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
TradeStation - How to place an order of GTC duration
I am trying to place an order thru a Strategy. The order submitted is defaulted to "DAY" duration. Which means it will get cancelled by end of the day. I am using range chart and hence each bar may span between days. I want to place the order with the duration GTC (Good to Cancel). Thx in advance.
Code used to place the order.
Buy "OrdName" 1 Contracts NEXT BAR AT High+0.01 Stop
Can you help answer these questions from other members on NexusFi?
You can use the OrderTicket object, i have included all properties you can set here
You only need to set the few you want to use.
Its the Duration field you want to change in your case, its a string containing the duration, like "DAY", "GTC", "GTC+", "30 min" etc. you can find the complete documentation in the easylanguage object reference.
Awesome. Thx for the quick response with the solution.
BTW, I had a chat with the TS technical helpdesk on this. They mentioned that the "DAY" order will be closed by end of the session. However, when the session starts again, the same "DAY" order will be placed again automatically. This will happen even though the RANGE bar is still in the midst of completing the range. I am now testing this in the SIM account. Will share the outcome here.
The code you shared gives great deal of flexibility when placing the order. Appreciated.
Let us know how that goes. In my experience, with Forex and TS, my stop order has been cancelled at 5pm EST since it is "day" only but when it goes to renew a few seconds later it responds with a "rejected" message (apparently this is due to some lag on the TS side settling for the day). Anyway, this can leave you in a tricky spot so beware. The problem will usually correct itself when the next bar on the Data1 stream closes, prompting the strategy to run again. This is not a big deal if Data1 is small such as 1m or 5m but can be a big deal if it's larger. You can write some object oriented checks as a safety mechanism but I won't go into that.
I have used tickets and still using them. Is there any other way to define order duration in Tradestation?
Also, does any of you sets order duration in FX using Tradestation? I don't get access to 1 min duration. Only IOC theoretically can cancel the order soon enough after its deployment.