NexusFi: Find Your Edge


Home Menu

 





Open trade at a certain time


Discussion in TradeStation

Updated
    1. trending_up 1,257 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 highjohn 
Durham, North Carolina
 
Experience: Beginner
Platform: TS
Trading: Futures
Posts: 34 since Mar 2022
Thanks Given: 42
Thanks Received: 3

Hi,

Is there a way to buy or sell at a certain time rather than at close of the bar?

If venter = 1 then Begin
If currententries = 0 then Buy("B1") Noofcontracts contract this bar at Close;
If currententries = 1 then Buy("B2") Noofcontracts contract this bar at Close;
venter= 0;
end;

Thanks!


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
 
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,738 since Jul 2012
Thanks Given: 1,918
Thanks Received: 7,487


highjohn View Post
Hi,

Is there a way to buy or sell at a certain time rather than at close of the bar?

If venter = 1 then Begin
If currententries = 0 then Buy("B1") Noofcontracts contract this bar at Close;
If currententries = 1 then Buy("B2") Noofcontracts contract this bar at Close;
venter= 0;
end;

Thanks!

if time=XXX then buy next bar at open;

You just have to have a bar with the time you list in the code.


Follow me on X Reply With Quote
  #3 (permalink)
 highjohn 
Durham, North Carolina
 
Experience: Beginner
Platform: TS
Trading: Futures
Posts: 34 since Mar 2022
Thanks Given: 42
Thanks Received: 3



kevinkdog View Post
if time=XXX then buy next bar at open;

You just have to have a bar with the time you list in the code.

Thank you. But the 'next bar' on the hourly chart may be after quite a bit of time. Isnt it?


Started this thread Reply With Quote
  #4 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,738 since Jul 2012
Thanks Given: 1,918
Thanks Received: 7,487


highjohn View Post
Thank you. But the 'next bar' on the hourly chart may be after quite a bit of time. Isnt it?


If time is an issue, you could use stop or limit orders:


If XXXX then buy next bar at YYYY stop;

If XXXX then buy next bar at ZZZZ limit;


those will execute during the next bar.

Also, you could look at Intrabar Order Generation, which would execute at next tick once a condition turns true. But you can't backtest with that.


Follow me on X Reply With Quote
Thanked by:
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

highjohn,

another approach could be using a lower timeframe for the trading. Either in conjunction with a higher timeframe on Data 2 or by tracking higher timeframe values internally within the code using the underlying lower timeframe.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:




Last Updated on April 3, 2023


© 2026 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 - Downloads - Top
no new posts