Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
The code should trade the break of the range of the first candle of the day, regardless the timeframes.
Sadly, it doesn't work......
Can you help answer these questions from other members on NexusFi?
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?
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?)
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.
You can use stop limit orders with Object Oriented EasyLanguage order objects, but these will only work in realtime.
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.
anyway....this is why i need stop-limits having tradestation as broker....
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