NexusFi: Find Your Edge


Home Menu

 





Platforms that support Intrabar trading for Automated trading


Discussion in Platforms and Indicators

Updated
    1. trending_up 6,982 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 2 attachments




 
Search this Thread

Platforms that support Intrabar trading for Automated trading

  #1 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9

Hi All,
Trying to find out if there are any automated trading plaforms that can do intrabar trading i.e. if a condition is met, a market order gets triggered right away.
I tried to do this extensively with Tradestation but it seems like the intrabar trading can be triggered only in the next bar, and not in the current bar.
Is there any platform that can do this?
Any suggestions are very much appreciated!
AP

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
26 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

apmodeler,

Tradestation can trigger orders intrabar. If Intrabar Order Generation is enabled either in your script or via the strategy settings the code is computed with every tick and "next bar" order statements in this context mean "next tick".

Regards,

ABCTG


apmodeler View Post
Hi All,
Trying to find out if there are any automated trading plaforms that can do intrabar trading i.e. if a condition is met, a market order gets triggered right away.
I tried to do this extensively with Tradestation but it seems like the intrabar trading can be triggered only in the next bar, and not in the current bar.
Is there any platform that can do this?
Any suggestions are very much appreciated!
AP


Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9


Hi ABCTG
This is a simple script that buys at the cross above and sells at the cross below of a moving average:

{------------------------------------------}
variables:
Avg( 0 );

Avg = AverageFC( Close, 9 );
[Intrabarordergeneration=true]
{Going Long}
if (Close crosses above Avg) then Buy ( "Long" ) next bar at market ;
if (Close crosses below Avg) then Sell ( "LongClose" ) next bar at market ;

{Going Short}
if (Close crosses below Avg) then Sell ( "Short" ) next bar at market ;
if (CLOSE crosses above Avg) then Buy to cover( "ShortClose" ) next bar at market ;
{------------------------------------------}

I am trying to trigger a market order right at the crossover (before the close of the current bar). But I am getting a fill at the next bar open.
Is there something wrong with script?
AP

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

apmodeler,

the script works fine for me and trades are executed intrabar. Did you enable the look inside bar backtesting feature as otherwise intrabar order generation strategies will only be calculated four times per historical bar and not with every tick?

The way you wrote your code you might not see short entries, though, as you are using the incorrect reserved word. Short entry orders are issued using SellShort or Sell Short.

Regards,

ABCTG


apmodeler View Post
Hi ABCTG
This is a simple script that buys at the cross above and sells at the cross below of a moving average:

{------------------------------------------}
variables:
Avg( 0 );

Avg = AverageFC( Close, 9 );
[Intrabarordergeneration=true]
{Going Long}
if (Close crosses above Avg) then Buy ( "Long" ) next bar at market ;
if (Close crosses below Avg) then Sell ( "LongClose" ) next bar at market ;

{Going Short}
if (Close crosses below Avg) then Sell ( "Short" ) next bar at market ;
if (CLOSE crosses above Avg) then Buy to cover( "ShortClose" ) next bar at market ;
{------------------------------------------}

I am trying to trigger a market order right at the crossover (before the close of the current bar). But I am getting a fill at the next bar open.
Is there something wrong with script?
AP


Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9

Hi ABCTG,
Thank you for the corrections and the feedback!

I did include [Intrabarordergeneration=true] in the code. The "Enable intrabar order generation and tabulation" looks disabled after adding this. My guess is that including [Intrabarordergeneration=true] has enabled intra bar orders.

If you look at the image below, I would assume that when the bar (in the dotted yellow box) crossing the moving average line a buy order would be triggered.



Which would be right at the 'Avg' value (of 69.15 as you can see below). However the it always seems to enter at the value of the 'close' (69.19).


Am I missing something here?
AP

Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

apmodeler,

your screenshot appears to show orders getting triggered on the same bar and the most right order is not on the Close.

What resolution are you using for the look inside bar backtesting settings?

Regards,

ABCTG



apmodeler View Post
Hi ABCTG,
Thank you for the corrections and the feedback!

I did include [Intrabarordergeneration=true] in the code. The "Enable intrabar order generation and tabulation" looks disabled after adding this. My guess is that including [Intrabarordergeneration=true] has enabled intra bar orders.

If you look at the image below, I would assume that when the bar (in the dotted yellow box) crossing the moving average line a buy order would be triggered.



Which would be right at the 'Avg' value (of 69.15 as you can see below). However the it always seems to enter at the value of the 'close' (69.19).


Am I missing something here?
AP


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9

Hi ABCTG,
This particular one was a 5 minute chart for crude oil futures.
It does enter on the same bar, but typically on the close of the current bar.
I'm trying to see if TS allows an order to get triggered in real time before the close of the bar?
AP

Started this thread Reply With Quote
  #8 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9

HI ABCTG,
I just tried it in a live trading session and it seems to be working. Didn't seem to work during backtesting. I guess it must be the conditions of trade.
Thank you so much for all your help!!
AP

Started this thread Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

Hi apmodeler,

my pleasure. You need to specifically enable the "Look Inside Bar Backtesting" settings and set a resolution (preferably 1 tick for your test) on the general tab of the strategy properties dialog window.
If you do not enable this feature intrabar order generation strategies will only be calculated four times per historical bar (with Open, High, Low, and Close) and not with every tick and this would explain why you only see fills at those four price points in your historical testing.

Enabling this feature with a one tick resolution should give you a similar behavior to what you are seeing in real time. Not using a resolution of 1 tick will result in the results only being accurate to what ever resolution you set, as the code will only be computed with that frequency on historical bars.

Regards,

ABCTG


apmodeler View Post
HI ABCTG,
I just tried it in a live trading session and it seems to be working. Didn't seem to work during backtesting. I guess it must be the conditions of trade.
Thank you so much for all your help!!
AP


Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
 apmodeler 
Boise, Idaho
 
Experience: Intermediate
Platform: TOS
Trading: Stocks
Posts: 37 since Aug 2013
Thanks Given: 56
Thanks Received: 9


I will try that. Gratitudes!!!

Started this thread Reply With Quote




Last Updated on August 13, 2021


© 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