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.
Can you help answer these questions from other members on futures io?
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.
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.
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,785 since Jun 2009
Thanks: 32,313 given,
97,574
received
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, 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
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
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;