NexusFi: Find Your Edge


Home Menu

 





TS inter bar order work around


Discussion in EasyLanguage Programming

Updated
      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 Big Mike with 1 posts (0 thanks)
    1. trending_up 12,687 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 15 posts
    2. attach_file 0 attachments




 
Search this Thread

TS inter bar order work around

  #1 (permalink)
workyboy
Lakeland, FL USA
 
Posts: 7 since Dec 2010
Thanks Given: 1
Thanks Received: 0

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 NexusFi?
Increase in trading performance by 75%
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
15 thanks
GFIs1 1 DAX trade per day journal
15 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #3 (permalink)
Doctor Leo
St. Petersburg, Russia
 
Posts: 30 since Nov 2010
Thanks Given: 6
Thanks Received: 19


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
  #4 (permalink)
workyboy
Lakeland, FL USA
 
Posts: 7 since Dec 2010
Thanks Given: 1
Thanks Received: 0


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
  #5 (permalink)
Doctor Leo
St. Petersburg, Russia
 
Posts: 30 since Nov 2010
Thanks Given: 6
Thanks Received: 19

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
  #6 (permalink)
workyboy
Lakeland, FL USA
 
Posts: 7 since Dec 2010
Thanks Given: 1
Thanks Received: 0

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
  #7 (permalink)
Doctor Leo
St. Petersburg, Russia
 
Posts: 30 since Nov 2010
Thanks Given: 6
Thanks Received: 19

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
  #8 (permalink)
workyboy
Lakeland, FL USA
 
Posts: 7 since Dec 2010
Thanks Given: 1
Thanks Received: 0


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
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599

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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
workyboy
Lakeland, FL USA
 
Posts: 7 since Dec 2010
Thanks Given: 1
Thanks Received: 0



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




Last Updated on May 7, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts