NexusFi: Find Your Edge


Home Menu

 





Mid-Bar Entries


Discussion in Platforms and Indicators

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




 
Search this Thread
  #1 (permalink)
Vientomarsol
Port St. Lucie, FL.
 
Posts: 25 since May 2016
Thanks Given: 17
Thanks Received: 9

I'm building a TradeStation strategy for automated execution (robot trader).

I want the ability to enter and exit mid-bar, or in a subsequent bar.
i.e. If conditions are met at 7 minutes into a fifteen minute bar, the entry or exit will be executed immediately without waiting for open of next bar. On the other hand; if conditions are not met for several bars, the strategy will execute mid-bar (of a subsequent bar) when conditions are met.

I am using "[IntrabarOrderGeneration = TRUE]" and coding as follows:

//Long Entry
If MP=0 and H=H[1] then buy this bar;
MP = 1;


//Long Exit
If MP=1 and H=H[1]-.25 then sell this bar;
MP = 0;

The exit is working, and will get me out instantly, but the entry is not. It delays until the open of the next bar.

How should I code the entry statement to execute instantly when conditions are met (in current or future bars)?

Thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
Six Days to Kickoff: World Cup Prediction Markets Hit $1 …
Prediction Markets & Event Contracts
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


Vientomarsol,

welcome to NexusFi. When using intrabar order generation in Tradestation "Next bar" orders will be executed at the next tick that is processed, while "this bar" orders will only be processed at the end of the bar. That's why you are getting your orders filled at the open only.

Regards,

ABCTG


Follow me on X Reply With Quote
  #4 (permalink)
Vientomarsol
Port St. Lucie, FL.
 
Posts: 25 since May 2016
Thanks Given: 17
Thanks Received: 9


ABCTG View Post
Vientomarsol,

welcome to NexusFi. When using intrabar order generation in Tradestation "Next bar" orders will be executed at the next tick that is processed, while "this bar" orders will only be processed at the end of the bar. That's why you are getting your orders filled at the open only.

Regards,

ABCTG



Thanks for your prompt reply.
I'll set-it-up as indicated and see how it works.

Respectlully,


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

Vientomarsol,

you are welcome. By the way you can show your appreciation for a post on NexusFi by clicking the "Thanks" button next to it.

Regards,

ABCTG


Vientomarsol View Post
Thanks for your prompt reply.
I'll set-it-up as indicated and see how it works.

Respectlully,


Follow me on X Reply With Quote




Last Updated on July 13, 2016


© 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