NexusFi: Find Your Edge


Home Menu

 





Cancel orders in a strategy


Discussion in TradeStation

Updated
    1. trending_up 5,048 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
Systematic Algo Trader
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,270 since Feb 2017
Thanks Given: 2,960
Thanks Received: 2,856

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


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Requests Tag 50 Trader Identity Data From CME and I …
Traders Hideout
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
Six Days to Kickoff: World Cup Prediction Markets Hit $1 …
Prediction Markets & Event Contracts
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Lands in Beijing on CPI Day: Iran Peace Expires To …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

vmodus,

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.

Regards,

ABCTG


Follow me on X Reply With Quote
  #3 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
Systematic Algo Trader
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,270 since Feb 2017
Thanks Given: 2,960
Thanks Received: 2,856


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.

~vmodus


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

vmodus,

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.

Regards,

ABCTG


vmodus View Post
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.

~vmodus


Follow me on X Reply With Quote
  #5 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
Systematic Algo Trader
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,270 since Feb 2017
Thanks Given: 2,960
Thanks Received: 2,856

Thanks @ABCTG . Here is a example of a short order, sent from the strategy:
 
Code
sell ("Short xOver") NumberOfContracts contract next bar at close + RngFrac * (H - L) limit ;
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?

Thanks,
~vmodus


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

vmodus,

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.

Regards,

ABCTG


vmodus View Post
Thanks @ABCTG . Here is a example of a short order, sent from the strategy:
 
Code
sell ("Short xOver") NumberOfContracts contract next bar at close + RngFrac * (H - L) limit ;
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?

Thanks,
~vmodus


Follow me on X Reply With Quote
Thanked by:
  #7 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
Systematic Algo Trader
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,270 since Feb 2017
Thanks Given: 2,960
Thanks Received: 2,856

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.

Thanks!


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on April 29, 2019


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts