Intra bar order @ pre determined time - futures io
futures io futures trading



Intra bar order @ pre determined time


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one jay j with 3 posts (0 thanks)
    2. looks_two Keystone with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 jsoctus with 1 posts (0 thanks)
    1. trending_up 5,117 views
    2. thumb_up 2 thanks given
    3. group 5 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

Intra bar order @ pre determined time

(login for full post details)
  #1 (permalink)
connecticut
 
 
Posts: 3 since Jul 2011
Thanks: 2 given, 0 received

could anyone help me on how to do an intra bar code for opening a breakout order a certain number of pips above/below current market price 3 seconds before a particular established time in TradeStation Easy language? I would be greatful, thank you in advance.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Cross border fund flows / fx correlations
Treasury Notes and Bonds
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received



jay j View Post
could anyone help me on how to do an intra bar code for opening a breakout order a certain number of pips above/below current market price 3 seconds before a particular established time in TradeStation Easy language? I would be greatful, thank you in advance.

I'm assuming you want a breakout bracket (with a buy and a sell order that cancels). I've included the code for minute resolution. As far as getting down to the second resolution, you'll need some help from there (I dunno). The inputs include the time at 10:00 a.m. and a number of ticks at 3.

[intrabarordergeneration = true]
inputs: timetrigger(1000), pricebreakgap(3);
variables: pricebreakup(0), pricebreakdown(0);

pricebreakup = currentask + (pricebreakgap*(minmove/pricescale));
pricebreakdown = currentbid - (pricebreakgap*(minmove/pricescale));

If marketposition=0 and time >= timetrigger then begin
Buy next bar at pricebreakup limit;
Sellshort next bar at pricebreakdown limit;
end;

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following user says Thank You to RM99 for this post:
 
(login for full post details)
  #4 (permalink)
connecticut
 
 
Posts: 3 since Jul 2011
Thanks: 2 given, 0 received

I do need it down to the second, but nevertheless I greatly appreciate your taking the time and the effort to give me the response you did. I thank you for the privilege of your help.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,785 since Jun 2009
Thanks: 32,313 given, 97,574 received


jay j View Post
I do need it down to the second, but nevertheless I greatly appreciate your taking the time and the effort to give me the response you did. I thank you for the privilege of your help.

To best of my knowledge, TradeStation doesn't support resolution more granular than 1 minute. MultiCharts does, if this is a requirement you might check it out.

One possible work around is to track when a new minute bar forms, then concurrently start tracking your local computer time from tick to tick so that you could trigger something at 57 seconds (3 seconds prior to the next minute bar).

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 futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #6 (permalink)
connecticut
 
 
Posts: 3 since Jul 2011
Thanks: 2 given, 0 received


Big Mike View Post
To best of my knowledge, TradeStation doesn't support resolution more granular than 1 minute. MultiCharts does, if this is a requirement you might check it out.

One possible work around is to track when a new minute bar forms, then concurrently start tracking your local computer time from tick to tick so that you could trigger something at 57 seconds (3 seconds prior to the next minute bar).

Mike

Mike, that is an excellent suggestion and might be the answer. I still think the process can be programeded in T.S. Easy language or in thinking out loud to myself if needed in C++ that T.S. also accepts now. That said you may have the best solution and will put that at the top of the list for now. I am very greatful for the time others offer to help.
Jay

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Hartford + CT/United States
 
 
Posts: 2 since Sep 2013
Thanks: 0 given, 0 received

In TradeStation, you can get the current time in minutes an seconds with the BarDateTime function. For example, to determine the time of the current bar, you can use
CurrentBarTime = BarDateTime[0].ELTime + ((BarDateTime[0].Second)/60);
John

Reply With Quote
 
(login for full post details)
  #8 (permalink)
Dallas Texas
 
Experience: Advanced
Platform: Tradestation
Trading: Emini ES, Emini YM
 
Posts: 11 since Sep 2013
Thanks: 0 given, 1 received

Tradestation does support time intervals as low as seconds.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
AUSTIN, TX
 
Experience: Advanced
Platform: Thinkorswim
Trading: stocks
 
Posts: 4 since Nov 2012
Thanks: 0 given, 0 received

I modified the code to close it at 14:55 (CST) on 1 minute chart. I have done something wrong, can you please let me know what have I done wrong.

[intrabarordergeneration = true]
inputs: timetrigger_start(0930), timetrigger_end(1455),pricebreakgap(10);
variables: pricebreakup(0), pricebreakdown(10);

pricebreakup = currentask + (pricebreakgap*(minmove/pricescale));
pricebreakdown = currentbid - (pricebreakgap*(minmove/pricescale));

If marketposition=0 and time >= timetrigger_start then begin
Buy next bar at pricebreakup limit;
Sellshort next bar at pricebreakdown limit;
end;

If marketposition = 1 and time = timetrigger_end then begin
Sell next bar at market; end
Else if marketposition = -1 and time = timetrigger_end then begin
Buytocover next bar at market;
end;

Reply With Quote
 
(login for full post details)
  #10 (permalink)
Dallas Texas
 
Experience: Advanced
Platform: Tradestation
Trading: Emini ES, Emini YM
 
Posts: 11 since Sep 2013
Thanks: 0 given, 1 received


It works on my system. Does your session have bars that exceed the end time?

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Intra bar order @ pre determined time


Last Updated on October 1, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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