NexusFi: Find Your Edge


Home Menu

 





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,972 views
    2. thumb_up 2 thanks given
    3. group 5 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Intra bar order @ pre determined time

(login for full post details)
  #1 (permalink)
jay j
connecticut
 
Posts: 3 since Jul 2011
Thanks Given: 2
Thanks Received: 0

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 NexusFi?
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Request for MACD with option to use different MAs for fa …
NinjaTrader
Futures Close-Out Policy
Commodities
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Battlestations: Show us your trading desks!
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
25 thanks

(login for full post details)
  #3 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704



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)
jay j
connecticut
 
Posts: 3 since Jul 2011
Thanks Given: 2
Thanks Received: 0

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)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368


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

Quick Links: Change your Username or Register as a Vendor


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


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive 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
The following user says Thank You to Big Mike for this post:
(login for full post details)
  #6 (permalink)
jay j
connecticut
 
Posts: 3 since Jul 2011
Thanks Given: 2
Thanks Received: 0


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)
jsoctus
Hartford + CT/United States
 
Posts: 2 since Sep 2013
Thanks Given: 0
Thanks Received: 0

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)
 Keystone 
Dallas Texas
 
Experience: Advanced
Platform: Tradestation
Trading: Emini ES, Emini YM
Posts: 12 since Sep 2013
Thanks Given: 0
Thanks Received: 5

Tradestation does support time intervals as low as seconds.

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

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)
 Keystone 
Dallas Texas
 
Experience: Advanced
Platform: Tradestation
Trading: Emini ES, Emini YM
Posts: 12 since Sep 2013
Thanks Given: 0
Thanks Received: 5


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

Reply With Quote





Last Updated on October 1, 2013


© 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