Limit Order - Auto Cancel - EasyLanguage Programming | futures io social day trading
futures io futures trading


Notices

Limit Order - Auto Cancel
Updated: Views / Replies:1,932 / 8
Created: by Vientomarsol Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Limit Order - Auto Cancel

  #1 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 22 since May 2016
Thanks: 14 given, 7 received

Limit Order - Auto Cancel

I’m looking for a way to code the following in TradeStation EL:

Cancel a limit order after XX minutes, if my price has been hit, but the order has not been filled.”

I found the following post on Futures.io which began with this question , but somehow evolved into a discussion of brokers and slippage.

Here is the link:• https://futures.io/easylanguage-programming/12991-easylanguage-mulitcharts-limit-orders.html

The initial response in this post was: “All orders are canceled and replaced at the start of each new bar. To cancel it in effect, just don't reissue the Buy or Sell order.”.

I don’t understand this answer. If I have a strategy order to “buy at XX on a limit”; and xx is hit, but the order is not filed; then certainly the order will sit there, waiting to be filled until:
a) it is filled, or
b) it is cancelled.

So; can anyone tell me how to code (in TS EL) a command to “Cancel a limit order after XX minutes, if my price has been hit, but the order has not been filled.” ?

Thank you in advance for your consideration.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary


Vientomarsol,

an order will remain "alive" as long as the condition you use to issue the order is valid. You can use this to your benefit by making the condition invalid after X minutes for example.
In your case you will likely require intrabar order generation and you need to detect if the price hit your limit price within your code.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 22 since May 2016
Thanks: 14 given, 7 received


ABCTG View Post
Vientomarsol,

an order will remain "alive" as long as the condition you use to issue the order is valid. You can use this to your benefit by making the condition invalid after X minutes for example.
In your case you will likely require intrabar order generation and you need to detect if the price hit your limit price within your code.

Regards,

ABCTG


Hello ABCTG,
Thanks (as always) for your prompt reply. You are a 'Beacon of Light' to all of us amateurs.

I'm using Kase charts in my trading, so Intrabar Order Generation is not allowed.

TradeStation offers a (non-EasyLanguage) option to convert an unfilled Limit Order to a Market Order after xx seconds. It seems like we should be able to code something similar for cancelling the unfilled Limit Order after xx seconds. No??

Any thoughts?

Reply With Quote
 
  #5 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary

Vientomarsol,

you are welcome. What I wrote is still valid, with or without intrabar order generation. However without IOG you can only reset the conditions at the end of the bar and thus cancel your order at that point (which will likely not match X minutes after the order was triggered).

You might be able to walk around this with OOEL, but you couldn't backtest your code then.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #6 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 22 since May 2016
Thanks: 14 given, 7 received

I'm OK with cancelling at end of bar (or beginning of next bar), but I can't seem to find the proper EL language.

Here is my entry code: (works well)

If Condition1
Then begin Buy ("LE") Next Bar (Close - .24) limit;
MP = 1;
End;


Here is my best guess at the 'Cancel' Code: (not working):

If Condition1[1] {referring to the prior bar with a Limit Entry signal}
and MP = 0 {referring to "Did not Get Filled"} then .CancelLastOrder;

TradeStation only allows the word 'Cancel' in one context (not this one). What other EasyLanguage word would do the trick?

Again, Thanks.

Reply With Quote
 
  #7 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary

Vientomarsol,

based on my above statement "an order will remain "alive" as long as the condition you use to issue the order is valid", the order would be cancelled by TS as soon as Condition1 (in your case) is not "true" anymore.

You would have to debug your code (using print statements for example) to check if setting MP = 1 at the location where you do it actually means you are filled, as from the code snippet I wouldn't necessarily expect that.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #8 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 22 since May 2016
Thanks: 14 given, 7 received

Thanks for your prompt reply. I don't know how (or why) you find the time to babysit guys like me.

OK - so per your response; I'll determine my Market Position (MP = 0 versus MP = 1) before and after my Limit Order has been triggered, but not filled.
Along with this, I'll determine my 'Condition 1' status on the 'Trigger bar' and subsequent bars.

Using these two data-points, I'll see if I can noodle-out a way to auto-cancel the order.

As always, thanks for your feedback. I learn something new about EasyLanguage from each of your posts.

Reply With Quote
 
  #9 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary

Vientomarsol,

you are welcome. Based on your code snippet you set MP = 1 when your Condition1 is fulfilled. Now it depends on what you mean with "your limit order got triggered" - as it could be the act of TS sending the limit order to the exchange/execution network or price touching/crossing your limit price. If you are looking for the sending of the order the code is fine, but if it's the latter you'd need to monitor if price touched/crossed your limit price.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures io > > > > > Limit Order - Auto Cancel

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Fundraiser: Feeding Families in Need (ends Dec 17)

December
 

Ask Me Anything (Brokers & Platforms) w/Ilan Levy Mayer @ Cannon Trading

Dec 13
 

Battlestations! Show us your trading desks w/GFF Brokers ($750 in Prizes)

January
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto order cancel ttiller NinjaTrader 5 December 4th, 2016 05:10 PM
Simple Limit Order with SL/TP/Cancel prosonic NinjaTrader Programming 3 August 14th, 2013 09:36 PM
cancel last order terratec NinjaTrader Programming 16 September 1st, 2011 02:17 PM
Chasing a limit order entry in an auto-strategy nanobiotech Elite Automated Trading 7 August 17th, 2011 06:39 AM
IOG causing my limit order to cancel and replace intrabar tradersheldon EasyLanguage Programming 10 August 2nd, 2011 10:03 AM


Tags
abc, backtest, backtesting, brokers, code, data, easylanguage, es, feedback, futures, how to, information, intrabar, limit order, market order, market position, multicharts, neoticker, programming, signal, slippage, strategy, tradestation, trading

All times are GMT -4. The time now is 09:10 AM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2018-12-12 in 0.13 seconds with 14 queries on phoenix