NexusFi: Find Your Edge


Home Menu

 





Cancel orders in a strategy


Discussion in TradeStation

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




 
Search this Thread

Cancel orders in a strategy

  #1 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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 Twitter Reply With Quote
  #3 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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 Twitter Reply With Quote
  #5 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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 Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on April 29, 2019


© 2024 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 - Privacy Policy - Downloads - Top
no new posts