Attaching stops / brackets to limit orders in Easylanguage - EasyLanguage Programming | futures io social day trading
futures io futures trading


Attaching stops / brackets to limit orders in Easylanguage
Updated: Views / Replies:770 / 6
Created: by TraderWalrus 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 90,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
 

Attaching stops / brackets to limit orders in Easylanguage

  #1 (permalink)
Trading Apprentice
Bangkok Thailand
 
Futures Experience: Intermediate
Platform: IB, MC
Favorite Futures: Forex, CL, ES
 
Posts: 30 since May 2016
Thanks: 14 given, 10 received

Attaching stops / brackets to limit orders in Easylanguage

I am using Multicharts with IB.

My strategy should enter with a limit order and exit with a bracket.
Below is a simplified version of my code:


Quoting 
if marketposition(0) = 0 then
buy next bar at x limit;

setstoploss(stopSize);

if marketposition(0) = 1 then
sell next bar at y limit;

That works well at the backtesting stage, but when I moved to automating it I am not happy with the way the orders are transmitted.

At the first stage the limit order is transmitted to IB, without any attached stop. The stop will be there only when the position was initiated (if it is initiated), at the next bar. This means that if I lose connection after sending the limit order, and then it is executed, I have no stop.

Is it possible to transmit a limit order with an attached stop (or even better, with an attached bracket)?

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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 854 received
Forum Reputation: Legendary


TraderWalrus,

unfortunately this is expected behavior when working without intrabar order generation (IOG). You would have to switch to IOG (which might bring other modifications to your code) when you want the stop in place during the entry bar already.

Regards,

ABCTG

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Bangkok Thailand
 
Futures Experience: Intermediate
Platform: IB, MC
Favorite Futures: Forex, CL, ES
 
Posts: 30 since May 2016
Thanks: 14 given, 10 received

Thank you for your quick reply, ABCTG.

Since I enter with limit orders at certain levels that may or may not be reached, if I switch to IOG this means my orders will be repeatedly transmitted and cancelled at every tick rather than at every bar, correct?

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 854 received
Forum Reputation: Legendary

TraderWalrus,

you are welcome. By the way you can show your appreciation using the "Thanks" button under a post.
The order stays active as long as the conditions that generated it stay true. If you don't change these, your order wouldn't get cancelled and resend.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #6 (permalink)
Trading Apprentice
Bangkok Thailand
 
Futures Experience: Intermediate
Platform: IB, MC
Favorite Futures: Forex, CL, ES
 
Posts: 30 since May 2016
Thanks: 14 given, 10 received

Actually, I don't want the stop to be placed during the entry bar. I want to be there already when the limit order is transmitted, since it may happen that my limit order is there for a while before it's executed - whether the script is evaluated every bar or every tick.

If I cannot have a "real" attached stop to my limit order then I think I need to rewrite the whole thing to use market orders that are executed when the price hits my intended entry rather then limit orders that are transmitted beforehand. Makes sense?


Last edited by TraderWalrus; May 25th, 2016 at 04:24 AM.
Reply With Quote
The following user says Thank You to TraderWalrus for this post:
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 854 received
Forum Reputation: Legendary

TraderWalrus,

I don't think you can have actual OSO orders in Multicharts, it would only work to send the stops and targets after the fill and MC will include them into one OCO bracket.
Therefore you might have to use the market order approach you described.

Regards,

ABCTG

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

Reply



futures io > > > > > Attaching stops / brackets to limit orders in Easylanguage

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
limit orders, fill rate, algotrading, backtesting, IOC orders. snusnufreak Emini Index Futures Trading 7 December 14th, 2015 07:15 PM
OCO orders, set Limit and Stop Limit automatically rice0721 ThinkOrSwim 4 January 12th, 2014 01:02 PM
Is Time an important factor when market orders fill limit orders? tinus The Elite Circle 5 October 9th, 2013 09:42 AM
EasyLanguage, Mulitcharts and Limit Orders nismo EasyLanguage Programming 28 April 4th, 2013 06:47 AM
Converting unfilled limit orders to market orders toddma MultiCharts 1 January 14th, 2013 10:11 PM


All times are GMT -4. The time now is 08:59 PM.

Copyright © 2017 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 2017-12-14 in 0.10 seconds with 19 queries on phoenix via your IP 54.221.73.186