TS inter bar order work around - futures io
futures io futures trading



TS inter bar order work around


Discussion in EasyLanguage Programming

Updated by supergonzo
      Top Posters
    1. looks_one workyboy with 6 posts (0 thanks)
    2. looks_two Doctor Leo with 4 posts (3 thanks)
    3. looks_3 djvie11 with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 10,024 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 15 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

TS inter bar order work around

(login for full post details)
  #1 (permalink)
Lakeland, FL USA
 
 
Posts: 7 since Dec 2010
Thanks: 1 given, 0 received

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

Reply With Quote

Can you help answer these questions
from other members on futures io?
converting useful Pine Script into Multicharts code
EasyLanguage Programming
Delta PVP ( POC )
MultiCharts
Trading Rig Upgrade for Backtesting/Optimization in Multicharts
MultiCharts
Historical option expirations
Brokers
Convert H Data TS to NT
NinjaTrader
 
 
(login for full post details)
  #3 (permalink)
St. Petersburg, Russia
 
 
Posts: 30 since Nov 2010
Thanks: 6 given, 19 received


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.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Lakeland, FL USA
 
 
Posts: 7 since Dec 2010
Thanks: 1 given, 0 received


Doctor Leo View Post
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 ;

Your interest is appreciated.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
St. Petersburg, Russia
 
 
Posts: 30 since Nov 2010
Thanks: 6 given, 19 received

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

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Lakeland, FL USA
 
 
Posts: 7 since Dec 2010
Thanks: 1 given, 0 received

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.

Reply With Quote
 
(login for full post details)
  #7 (permalink)
St. Petersburg, Russia
 
 
Posts: 30 since Nov 2010
Thanks: 6 given, 19 received

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?

Reply With Quote
 
(login for full post details)
  #8 (permalink)
Lakeland, FL USA
 
 
Posts: 7 since Dec 2010
Thanks: 1 given, 0 received


Doctor Leo View Post
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.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,143 since Jun 2009
Thanks: 31,812 given, 95,784 received

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.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #10 (permalink)
Lakeland, FL USA
 
 
Posts: 7 since Dec 2010
Thanks: 1 given, 0 received



Big Mike View Post
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.

Mike

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?

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > TS inter bar order work around


May 7, 2018


Upcoming Webinars and Events
 

Bookmap

Nov TBD
     



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