Stop Limit Code - EasyLanguage Programming | futures io social day trading
futures io futures trading


Stop Limit Code
Updated: Views / Replies:341 / 9
Created: by Edwin Lefevre 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

 
 
Thread Tools
 

Stop Limit Code

 
Scotland
 
 
Posts: 16 since May 2019
Thanks: 5 given, 0 received

Stop Limit Code

Hi i'm trying to add a stop limit to my strategy.

I have the followinng code but it does not seem to be working.

var:

limit_stop_long = (entryprice-(minmove*sl));
limit_stop_short = (entryprice+(minmove*sl));

...

if MarketPosition > 0 then

setprofittarget_pt(tp);

sell next bar at limit_stop_long stop limit_stop_long limit;

if MarketPosition < 0 then

setprofittarget_pt(tp);

buytocover next bar at limit_stop_short stop limit_stop_short limit;

 
 
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.

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,127 since Apr 2013
Thanks: 380 given, 1,365 received


Edwin Lefevre,

what does "it does not seem to be working" mean? What does the code do versus what should the code do?
Are there any error messages? What is the platform you are coding this in (Multicharts or Tradestation)?

Regards,

ABCTG

Follow me on Twitter Visit my Facebook
 
 
Scotland
 
 
Posts: 16 since May 2019
Thanks: 5 given, 0 received

Hey,

the stop does not seem to be triggerinng.

The position either goes to the take profit limit or keeps going until I cover the position at the end of the session.

I want it to reach the stop level and put a limit order in the book at that price. Closing my position.

I'm doinng this to stop the slippage of a market order - even if only 1 tick.

I understand that there is a chance that stop limit will not trigger but it seems that this is not triggering at all in any instance.

Im using Multicharts.

Cheers.

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,127 since Apr 2013
Thanks: 380 given, 1,365 received

Edwin Lefevre,

it might make sense for you to use the print reserved word to check the values you are using for the stop and limit prices when you issue the order.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook
The following user says Thank You to ABCTG for this post:
 
 
Scotland
 
 
Posts: 16 since May 2019
Thanks: 5 given, 0 received


ABCTG View Post
Edwin Lefevre,

it might make sense for you to use the print reserved word to check the values you are using for the stop and limit prices when you issue the order.

Regards,

ABCTG

Thanks, seems I have negative numbers.

What data does print reference?

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,127 since Apr 2013
Thanks: 380 given, 1,365 received

Edwin Lefevre,

it prints the values of variables and reserved words (that you included in the print statement) at the time your code executes the print statement.

Regards,

ABCTG



Edwin Lefevre View Post
Thanks, seems I have negative numbers.

What data does print reference?


Follow me on Twitter Visit my Facebook
 
 
Agoura Hills, CA USA
 
Trading Experience: Intermediate
Platform: Tradestation
Broker/Data: TradeStation
Favorite Futures: Futures & Equities
 
numberjuani's Avatar
 
Posts: 108 since Apr 2019
Thanks: 6 given, 74 received


Edwin Lefevre View Post
Thanks, seems I have negative numbers.

What data does print reference?

HI Edwin, From what I understand TS strategy only support StopLoss Order, which are a stop market, and Limit as SetProfitTarget.

but a way to hack it into being a limit would be :

if C crosses below (StopLevel) then
Sell next bar at (StopLevel) Limit;

In my opinion its a bad idea all around, because it will take away from the fidelity of your backtest and you will always need very fine LIBB. You will also need to make sure you have the box checked about limit order fills. I would recommend you simply add a couple of ticks of slippage and comms and design your strategy work with it.

 
 
Scotland
 
 
Posts: 16 since May 2019
Thanks: 5 given, 0 received


numberjuani View Post
HI Edwin, From what I understand TS strategy only support StopLoss Order, which are a stop market, and Limit as SetProfitTarget.

but a way to hack it into being a limit would be :

if C crosses below (StopLevel) then
Sell next bar at (StopLevel) Limit;

In my opinion its a bad idea all around, because it will take away from the fidelity of your backtest and you will always need very fine LIBB. You will also need to make sure you have the box checked about limit order fills. I would recommend you simply add a couple of ticks of slippage and comms and design your strategy work with it.

Im using Multicharts - posted in wrong section my accident.

I'm still having trouble making the stop limit work. I'm pretty sure its how im calculating the stop from the entry.. You would think that there would be a simple function for stop limit and stop limit trailing.

Problem I'm having is a I had a great system developed. But then realised that I had been market buying in and not accounting for slippage. Even with 1 tick slippage the system is broken.

I tried half slippage to account for say 50% of the time buying market is on the bid or ask the same as backtesting. It was a little better.

If I can limit in and out then I might salvage the premise of the strategy.

 
 
Agoura Hills, CA USA
 
Trading Experience: Intermediate
Platform: Tradestation
Broker/Data: TradeStation
Favorite Futures: Futures & Equities
 
numberjuani's Avatar
 
Posts: 108 since Apr 2019
Thanks: 6 given, 74 received



Edwin Lefevre View Post
Im using Multicharts - posted in wrong section my accident.



I'm still having trouble making the stop limit work. I'm pretty sure its how im calculating the stop from the entry.. You would think that there would be a simple function for stop limit and stop limit trailing.



Problem I'm having is a I had a great system developed. But then realised that I had been market buying in and not accounting for slippage. Even with 1 tick slippage the system is broken.



I tried half slippage to account for say 50% of the time buying market is on the bid or ask the same as backtesting. It was a little better.



If I can limit in and out then I might salvage the premise of the strategy.



TS and MC are the same for easylanguage purposes . Is this an intraday strategy?


Sent using the futures.io mobile app


 



futures io > > > > > Stop Limit Code
Thread Tools



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

Show us your trading desks and win $1,400 in prizes w/Earn2Trade

November
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
OCO orders, set Limit and Stop Limit automatically rice0721 ThinkOrSwim 5 January 3rd, 2019 04:28 PM
Buy Limit, Buy with Stop or enter a Stop Limit ..... mdsvtr Traders Hideout 2 July 14th, 2015 01:02 PM
Limit vs stop vs stop-limit orders ghl123 Traders Hideout 10 April 29th, 2015 04:01 AM
Limit Up Limit Down Question MV007 Traders Hideout 19 April 6th, 2014 06:46 AM
Is the "stop limit" used as a protective stop, and what does "off-set" mean shots fired NinjaTrader 2 July 23rd, 2013 03:01 PM


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

Copyright © 2019 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