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)
I have been trying to figure out how to automate inter bar orders on Trade Station with Kase, range, or momentum bars.
Has any one figured out a work around and willing to share their code or concept?
Any help would be greatly appreciated,
Workyboy
Can you help answer these questions from other members on NexusFi?
Not quite sure about the bar types you mentioned, as I do not use TradeStation, but usually when I want to make sure the system works correctly intrabar, I use to data streams. This simplifies life a great deal. If you could give an example of what you mean I think I could help some more.
In Trade Station they do not allow a strategy to execute an order inter bar on the mentioned type of charts. Most of the great entries occur inter bar on longer charts, such as coiled springs, bar lows or high, break out reversals, etc.
This is valid coding;
if CurrentBar > 2 and Value1 crosses over Value2 then
Buy ( "MacdLE" ) next bar at market ;
This is what I would like to do;
if CurrentBar > 2 and Value1 crosses over Value2 then
Buy ( "MacdLE" ) this bar at market ;
You cannot use "this bar at market" as according to EL semantics it would mean buying at the opening of this current bar — which means entering the market in the past (sort of peek ahead). You can only use "this bar on close" and in this case most often you'd get the same as for "next bar at market" — with a tiny exception for gaps between this bar's close and next bar's opening.
Initially I thought you meant something like "next bar at xxx limit" — I don't know if it's allowed to do for special bar types in TS, but I'd rather prohibited it as a source of constant unrealistic and overoptimistic backtesting results
You are dead on about overly optimistic back testing results. I back test to find settings but use the results from live testing as a guide.
My example of code might have been a little misguided.
Maybe it should have been more like this;
If C=P then buy this bar at P limit.
P is my price projection.
I'm afraid there's a mistake again in your code. If close = some_price then you can't set a limit order at this very some_price. Anyway, you can't use "this bar at xxx limit" on any kind of bars. This is because it is impossible to guess the exact price movement within a single bar. Therefore one never knows if your order is filled or not. In general using intra-bar order generation is a very dangerous practice. If you're not satisfied with the resolution of your working timeframe maybe you'd want to try lower timeframes or consider using two timeframes?
Dr. Leo,
In general I have to agree with you and every thing you say is true except, "This is because it is impossible to guess the exact price movement within a single bar." That is the beauty of range type bars. You can forecast the exact high or low on the tick and be accurate. If you know that then you know when to enter or exit for that particular bar.
Back to the problem. How to transfer that data to a chart that you can use the intra-bar order generation feature for a strategy.
Only speaking from MultiCharts experience, not TradeStation, but make data1 a 1-range or 1-tick chart, and data2 the "useful" chart that you desire (kase, range, whatever) and then you can do your calculations on data 2 including predicting the closing price of the bar, and submit your orders via data1.
Yes, that is the simple way on time charts which is supported in TS. Range type charts are not.
I know that I need DLL, Global Variable, and/or ADE(All Data Everywhere). The question is; How do you combine them all together to work?