NexusFi: Find Your Edge


Home Menu

 





Easylanguage OCO orders


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one RM99 with 7 posts (2 thanks)
    2. looks_two Big Mike with 4 posts (1 thanks)
    3. looks_3 SPTrading with 3 posts (2 thanks)
    4. looks_4 diverdan with 2 posts (0 thanks)
      Best Posters
    1. looks_one Jura with 1 thanks per post
    2. looks_two SPTrading with 0.7 thanks per post
    3. looks_3 RM99 with 0.3 thanks per post
    4. looks_4 Big Mike with 0.3 thanks per post
    1. trending_up 24,573 views
    2. thumb_up 7 thanks given
    3. group 7 followers
    1. forum 20 posts
    2. attach_file 0 attachments




 
Search this Thread

Easylanguage OCO orders

(login for full post details)
  #11 (permalink)
 SPTrading 
London, England
 
Experience: Intermediate
Platform: MC, TS, NT
Broker: TradeStation
Trading: ES
Posts: 41 since Oct 2009
Thanks Given: 12
Thanks Received: 21


RM99 View Post
In fairness, if you lose connection, even manually using the OCO from the matrix, the order(s) that are on the tradeserver still don't function properly. That is to say, if you enter and have a simple bracket placed out on the tradeserver, and you lose connection, whichever exit is triggered first, there's no way for the tradeserver to receive a cancellation order for the other end of the bracket.

Well, again, this is where TS actually scores well compared to most trade platforms, and this seems to be a much overlooked issue: with TS your OCO is held on their server and is NOT dependent on your connection being maintained. The same applies if you send a .placeorder from your strategy.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
NinjaTrader
IQFeed MBO data experience
The Elite Circle
SPY ETF Question
Stocks and ETFs
Volume profile TradeStation
EasyLanguage Programming
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
GFIs1 1 DAX trade per day journal
28 thanks
Tao te Trade: way of the WLD
24 thanks
Diary of a simple price action trader
17 thanks
Daytrading ES & NQ
14 thanks
Deaddogs Stock Trading
13 thanks

(login for full post details)
  #12 (permalink)
 SPTrading 
London, England
 
Experience: Intermediate
Platform: MC, TS, NT
Broker: TradeStation
Trading: ES
Posts: 41 since Oct 2009
Thanks Given: 12
Thanks Received: 21

I was going to say, that it isn't all exactly perfect because I sometimes get severe slippage on ES using TradeStations OCO orders and guess what it happened just now. How about 10 ticks of slippage?! 10 mins after the open I was short with a stop around the open and in profit and then I am looking at a matix with the price 10 ticks above my stop. My position was only closed after pressing the cancel all. Just 1 contract. My conclusion: TS servers are not up to the job and I need to change broker asap.

Reply With Quote
(login for full post details)
  #13 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704



SPTrading View Post
I was going to say, that it isn't all exactly perfect because I sometimes get severe slippage on ES using TradeStations OCO orders and guess what it happened just now. How about 10 ticks of slippage?! 10 mins after the open I was short with a stop around the open and in profit and then I am looking at a matix with the price 10 ticks above my stop. My position was only closed after pressing the cancel all. Just 1 contract. My conclusion: TS servers are not up to the job and I need to change broker asap.

I've complained that the stop order convention isn't practical.

"Stop" in tradestation means at or better for entries and at or worse for exits.

I don't know why it's so difficult for them to craft a limit order stop feature. As it is, I craft my own custom stops using limit orders and therefore, I'm guaranteed no more than a tick or 2 of slippage.

I simply use current price +/- the current bid/ask with a pricegap (input variable) to ensure the order doesn't get jumped in high velocity conditions.

I'm not nearly as concerned about partial fill issues with exits on my "stops" because my trails are always on the leeward side. So if price runs into my stop and fills completely, that's what it's supposed to do. If price runs into my stop and partially fills and continues on, then I continue making profit (just not the full positionsize).

Reply With Quote
(login for full post details)
  #14 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344

 
Thread Moved


Moved to EasyLanguage Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading



Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #15 (permalink)
 diverdan 
Singapore
 
Experience: Beginner
Platform: Multicharts, R
Trading: EUR / USD
Posts: 185 since Feb 2010
Thanks Given: 106
Thanks Received: 99

Has anyone tried to program straddle orders, where you place into the market a buy and sell at the same time, cancelling one when the other order gets filled?

This is typically used for news trading.

Edit - I've found an answer from RM99 on another thread

Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #16 (permalink)
 diverdan 
Singapore
 
Experience: Beginner
Platform: Multicharts, R
Trading: EUR / USD
Posts: 185 since Feb 2010
Thanks Given: 106
Thanks Received: 99


RM99 View Post
Keep in mind that when you have more than one pending order (like a typical bracket) that it violates TS's 15 second rule, so your orders will not be maintained on the tradeserver in the event of a loss of connection. if you use a single trailing stop, without IOG=True, then your trailing stop will only update every 15 seconds by default (unless of course you turn on IOG and then it will be tick/tick). Any exit code, with IOG on violates the 15 second rule.

Does anyone know whether MC has a "15 second rule" like TS?

Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #17 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344


diverdan View Post
Does anyone know whether MC has a "15 second rule" like TS?

It does not.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #18 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


Big Mike View Post
It does not.

Mike

Yes, but to be fair and thorough, MC is not a broker. It's up to the broker as to their limits/requirements as to how often you can send an order.

The reason that TS has the 15 second rule is to prevent MASSIVE amounts of orders being generated and cancelled (all with an order confirmation number and a cancellation confirmation) with respect to strategies that update on a tick/tick basis.

Now, having said that, I think TS is one of the few brokers that will actually maintain your orders natively at the their tradeserver.

What would be an IMPROVEMENT is rather than have a 15 second rule (and violation default) would be if TS had a happy medium, where the native/permanently held stop is only updated every 15 seconds.

As it stands now, if you have a strategy that either A) has more than one static exit stop, the strategy toggles back and forth and this violtes the 15 second rule or B) has a trailing stop or a stop that moves/adjusts tick/tick.....

Then TS violates you and your orders are simply not maintained on the tradesever. In essence, you are now flying blind in the event you lose workstation connectivity.

What would be an awesome adaptation, is for TS to update the stop location every 15 seconds (just the location information) and in the event that you lose connection, use the last update. That way, you could continue to operate tick/tick but in the loss of a connection, you at least have some stop on the server.

Another idea would be to simply establish a worse case scenario ("doomsday") stop and in the event you lose connection, that stop would be in effect.

Either way, it doesn't seem to me that TS is very concerned about any of this. I think TS is so large and has so many subscribers who are perfectly content with very basic operation, that they view these advanced features as more trouble than they're worth. In essence, TS isn't really concerned about these types of modifications or upgrades, because they have 10x as many people who will continue to use TS, without them.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
(login for full post details)
  #19 (permalink)
dcraw999
New Orleans, Louisiana, USA
 
Posts: 1 since Oct 2011
Thanks Given: 1
Thanks Received: 0


RM99 View Post
Just generally speaking?

It's "inherent."

For example...
/////////////////////////////////////////////////////////////////////////////////////////////
Inputs: StopProfit(100), StopLoss(100);

If MarketPosition <> 0 then begin

setstopcontract;
setprofittarget(StopProfit);
setstopcontract;
setstoploss(StopLoss);

end;
////////////////////////////////////////////////////////////////////////////////////////////

In the above example, setstopcontract (or setstopshare) sets the following code on a "per contract" or "per share" basis. If you want to set based on the overall position basis use "setstopposition;"

You can also combine profit targets with trailing stops (there's a variety on TS).

The OSO (supplemental) order is inherent as well. You simply code for your entry and then use the if MP then.....statement to ensure you immediately enact a "supplemental" order to cover your exit.

Keep in mind that when you have more than one pending order (like a typical bracket) that it violates TS's 15 second rule, so your orders will not be maintained on the tradeserver in the event of a loss of connection. if you use a single trailing stop, without IOG=True, then your trailing stop will only update every 15 seconds by default (unless of course you turn on IOG and then it will be tick/tick). Any exit code, with IOG on violates the 15 second rule.

Hope this helps.


Does the above work in TS2000i? I'm just starting out and I get conflicting story's about OCO orders in EasyLanguage. I just want to use this for end of day testing. I'm trying to do something along the lines of "Close trade OCO: a) 3 point profit or b) MOC Friday"

Reply With Quote
(login for full post details)
  #20 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344



dcraw999 View Post
Does the above work in TS2000i? I'm just starting out and I get conflicting story's about OCO orders in EasyLanguage. I just want to use this for end of day testing. I'm trying to do something along the lines of "Close trade OCO: a) 3 point profit or b) MOC Friday"

To best of my knowledge, TradeStation does not have IntrabarOrderGeneration capabilities. But you should be able to run your test without that.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote





Last Updated on October 31, 2011


© 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