stop-limit order easylanguage tradestation - TradeStation | futures io social day trading
futures io futures trading


stop-limit order easylanguage tradestation
Updated: Views / Replies:749 / 7
Created: by w4rri0r Attachments:2

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
 

stop-limit order easylanguage tradestation

  #1 (permalink)
Trading Apprentice
world's citizen
 
Futures Experience: Master
Platform: Tradestation, Sierra
Broker/Data: many
Favorite Futures: NQ, CL, METALS, FDAX, FDXM, NK, E7, J7, BP, BTC, XBT ,
 
Posts: 45 since Oct 2015
Thanks: 10 given, 6 received

stop-limit order easylanguage tradestation

Hi,
i'm trying to code a Stop-Limit order with easylanguage for Tradestation.
Unfortunately (!) TS don not provide a built -in stop-limit order to insert in strategies so as reported by tech support (!) one need to "mimic" the order and coding a "synth stop-limit" with Intrabar Order Generation (IOG)

I've tryied but IOG seems to overcomplicate simple task so maybe someone can help me to solve the issue...

below the code provided by TS support

 
Code
[intrabarordergeneration = true]
inputs:
LimitOffsetTicks( 5 ),
BarsToSetRange( 5 ) ;
variables:
OpenRange( false ),
OpenRangeHigh( 0 ),
OpenRangeLow( 0 ),
LongStopPrice( 0 ),
ShortStopPrice( 0 ),
Count( 0 ),
intrabarpersist EnterLong( false ),
intrabarpersist EnterShort( false ),
intrabarpersist EnteredToday( false ),
ATick( MinMove / PriceScale ),
MP( 0 ) ;

MP = MarketPosition ;

if MP <> 0 then
begin
EnteredToday = true ;
EnterLong = false ;
EnterShort = false ;
end ;

if Date <> Date[1] then
begin
OpenRangeHigh = High ;
OpenRangeLow = Low ;
Count = 1 ;
EnteredToday = false ;
end
else if Count < BarsToSetRange then
begin
OpenRangeHigh = MaxList( High, OpenRangeHigh ) ;
OpenRangeLow = MinList( Low, OpenRangeLow ) ;
Count += 1 ;
end
else if EnteredToday = false then
begin
if Close crosses above OpenRangeHigh + ATick then
begin
EnterLong = true ;
EnterShort = false ;
end
else if Close crosses below OpenRangeLow - ATick then
begin
EnterShort = true ;
EnterLong = false ;
end ;
end ;


if EnterLong then
begin
Buy next bar at OpenRangeHigh + ATick + LimitOffsetTicks * ATick Limit ;
end ;

if EnterShort then
begin
SellShort next bar at OpenRangeLow - ATick - LimitOffsetTicks * ATick Limit ;
end ;

if BarsSinceEntry = 5 then
begin
Sell next bar at Market ;
Buy to Cover next bar at Market ;
end ;


The code should trade the break of the range of the first candle of the day, regardless the timeframes.
Sadly, it doesn't work......

Reply With Quote
 
  #2 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

w4rri0r,

what settings do you use for the look inside bar backtesting? Anything above 1 tick will give you results that are different from what the code would produce in realtime.

When you say "it doesn't work", what does the code do exactly?

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Trading Apprentice
world's citizen
 
Futures Experience: Master
Platform: Tradestation, Sierra
Broker/Data: many
Favorite Futures: NQ, CL, METALS, FDAX, FDXM, NK, E7, J7, BP, BTC, XBT ,
 
Posts: 45 since Oct 2015
Thanks: 10 given, 6 received



ABCTG View Post
w4rri0r,

what settings do you use for the look inside bar backtesting?

IBB = 1 tik


Quoting 
When you say "it doesn't work", what does the code do exactly?

The code should trade the break of the range of the first candle of the day, regardless the timeframes - because Tradestation don't allow stop-limit orders in it's code (there not a built-in for stop-limit), and because the slippages are very very large (on MSFT i can have a 20 cents slippage for a stop order!), I was trying to "mimic" a stop-limit...to protect me from the exorbitant slippage provided....

(maybe easylanguage ond IOG are not the best to code something like that...maybe better drop Tradestation and go with a C# or C++ based coding language?)

Reply With Quote
 
  #4 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

w4rri0r,

looking at your code and an example on 30 min @ES.D it seems to do what you want it to do - under the condition that BarsToSetRange is set to 1. Based on that the problem might not be code related, unless I am not seeing the wrong behavior.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


You can use stop limit orders with Object Oriented EasyLanguage order objects, but these will only work in realtime.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Trading Apprentice
world's citizen
 
Futures Experience: Master
Platform: Tradestation, Sierra
Broker/Data: many
Favorite Futures: NQ, CL, METALS, FDAX, FDXM, NK, E7, J7, BP, BTC, XBT ,
 
Posts: 45 since Oct 2015
Thanks: 10 given, 6 received


ABCTG View Post
w4rri0r,

looking at your code and an example on 30 min @ES.D it seems to do what you want it to do - under the condition that BarsToSetRange is set to 1. Based on that the problem might not be code related, unless I am not seeing the wrong behavior.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


You can use stop limit orders with Object Oriented EasyLanguage order objects, but these will only work in realtime.

Regards,

ABCTG

so maybe it's because of the latest Tradestation update?
can u check if it work even on MSFT chart please?

how can i mix Object Oriented EasyLanguage and strategies? Is it even possible? can you provide an example, please?

Reply With Quote
 
  #6 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

w4rri0r,

it works fine here on MSFT, too.

I don't think it has something to do with the TS version or the code, but is more likely a settings issue. It could for example be that the tick data is not present, although you have LIB set to 1 tick. But without a chart and your settings one could only guess.

You shouldn't mix order objects with regular orders and you can find plenty of examples for order objects in the official Tradestation forum.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #7 (permalink)
Trading Apprentice
world's citizen
 
Futures Experience: Master
Platform: Tradestation, Sierra
Broker/Data: many
Favorite Futures: NQ, CL, METALS, FDAX, FDXM, NK, E7, J7, BP, BTC, XBT ,
 
Posts: 45 since Oct 2015
Thanks: 10 given, 6 received


ABCTG View Post
w4rri0r,

it works fine here on MSFT, too.

I don't think it has something to do with the TS version or the code, but is more likely a settings issue. It could for example be that the tick data is not present, although you have LIB set to 1 tick. But without a chart and your settings one could only guess.

the code i'm using it's exctly the same posted with BarsToSetRange set to 1

i'll check about the tick data

thanks

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
world's citizen
 
Futures Experience: Master
Platform: Tradestation, Sierra
Broker/Data: many
Favorite Futures: NQ, CL, METALS, FDAX, FDXM, NK, E7, J7, BP, BTC, XBT ,
 
Posts: 45 since Oct 2015
Thanks: 10 given, 6 received

anyway....this is why i need stop-limits having tradestation as broker....

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


slippage of 60 cents (!) so instead to open the trade at 20ish it's been opened at 2060ish...the target was 20.60ish...so after the buy the bot immediately tried to sell....30 cents lower
so instead of a 400ish win i've got a 200ish loss + commissions

Reply With Quote

Reply



futures io > > > > stop-limit order easylanguage tradestation

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

September Journal Challenge (sponsored by TopstepTrader)

September

Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri
 

Trading with Python: Using Machine Learning w/Ran Aroussi [12:30PM ET]

Elite only

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Place order from indicator in TradeStation Easylanguage loi5139 TradeStation 3 June 15th, 2016 08:31 PM
ATM Strategy: Limit order & stop loss order at the same time in the market? DrE6 NinjaTrader 2 June 21st, 2013 01:12 PM
Limit Order and Trailing Stop Tiger45 NinjaTrader Programming 7 May 9th, 2013 05:57 AM
stop/limit order question stefan416 NinjaTrader 5 August 14th, 2012 03:08 PM
Stop Limit Order Big Mike Terms (Glossary) 0 July 2nd, 2010 11:37 AM


All times are GMT -4. The time now is 02:40 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-09-20 in 0.15 seconds with 15 queries on phoenix