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)
I was wondering if anyone in the community knows how to cancel an order within a strategy using EasyLanguage. I am sometimes in need of canceling an order that has been placed, or doing an OCO (order cancels order).
Can anyone point me in the right direction? I'm sure it can be done, I just don't know how and the online help is not helping.
Thanks!
~vmodus
Can you help answer these questions from other members on NexusFi?
in general a strategy order will stay alive as long as the conditions are valid that issue the order. You can use this to cancel an order, but keep in mind that without intrabar order generation the order would only be cancelled at the end of the bar in case the conditions are no longer present.
Thanks @ABCTG . The problem I am trying to solve is not a market order (or order within the strategy) , but rather a limit order that has been sent. A strategy condition may invalidate the reason for the order before it is actually filled. So it becomes a matter of reaching out to the network and cancelling the order. I am getting some orders sent (e.g. buy 1 long @ 14.65, then buy 1 long @ 14.60). Anyhow, they both eventually get filled. I'm looking for something like order cancels order (OCO) or something similar.
I'm sure I could do this if I were transacting via API, but we're a long way from doing that.
how is the order sent? If you send it manually you should be able to send orders as OCO Bracket. You can also access active orders using Object Oriented Easylanguage.
Thanks @ABCTG . Here is a example of a short order, sent from the strategy:
Once it gets sent to Tradestation, then it is just part of the Bid or Ask queue at that price. I have to go to the Trade Manager to cancel or change the order.
I have not heard of Object Oriented EasyLanguage. It sounds like C#, if I were to guess. Can you point me to a resource so I can explore?
if you want to cancel this order from within the same strategy use a condition together with issuing the order.
As long as the condition is valid the order will be issued and you can cancel unfilled orders by invalidating the condition.
Tradestation has some courses on their website regarding OOEL, but a good start might be the primer that androidmarvin wrote and published in the official forum.
Your suggestion is a novel approach. I can think of a couple of ways that I can do it. I see it happen sometimes in one of my strategies, where a new condition comes in and I get the 'UROut' status for an order.