futures io



Intrabar Order Generation not working


Discussion in TradeStation

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




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Intrabar Order Generation not working

(login for full post details)
  #1 (permalink)
timfel
London, UK
 
 
Posts: 9 since Mar 2023
Thanks: 3 given, 0 received

As I understand it, if you enable Intrabar Order Generation, then buy or sell at next bar instructions execute at the next tick, rather than the next bar — this is what I want to happen.

However, I have done this, both by stating it in the code and turning it on in the strategy settings and backtesting settings, and it is only executing on the next bar.

On the 5 min chart, all entries and exits (stop loss and TP orders) are happening in 5 minute increments, when they should be happening at all times. Also the order is executing at the next bar open price, rather than the signal price.

Any ideas?

Code fragment:

 
Code
	  
If (T > RangeEnd) AND (T < LastOrders)  AND (TradeCount < MaxTrades) AND (Marketposition = 0) Then	  
	Begin	  
		If H crosses over RangeHigh Then  
			Begin  
				Buy ("Long") next bar at Market;  
				TradeCount = TradeCount + 1;  
			End;  
		  
		If L crosses under RangeLow  Then  
			Begin  
				Sellshort ("Short") next bar at Market;  
				TradeCount = TradeCount + 1;  
			End;  
			  
			  
		  
  
	End;

Reply With Quote

Can you help answer these questions
from other members on futures io?
Mt5 Tradestation Integration
TradeStation
How to get Index/Equity Data for NT?
NinjaTrader
Determination of intraday rise and fall
EasyLanguage Programming
Convert Pine Code to NT8
Platforms and Indicators
Rival systems and Exegy
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Artificial Intelligence (AI) and Chat GPT
28 thanks
New NinjaTrader
27 thanks
Spoo-nalysis ES e-mini futures S&P 500
27 thanks
Is anyone actually making money?
18 thanks
how to avoid chop
6 thanks

 
(login for full post details)
  #2 (permalink)
RandyK0615
Grand Junction, CO
 
 
Posts: 3 since Mar 2022
Thanks: 0 given, 1 received

Are you using intrabarpersist variables? If not, that might be your problem. Also be sure you have things set to
"update every tick".

Reply With Quote
 
(login for full post details)
  #3 (permalink)
timfel
London, UK
 
 
Posts: 9 since Mar 2023
Thanks: 3 given, 0 received



RandyK0615 View Post
Are you using intrabarpersist variables? If not, that might be your problem. Also be sure you have things set to
"update every tick".

Yes I have used intrabar persist. What it appears on further investigation is that the trades are actually executing intrabar, but they were only being reported on bar close, which is why they were all at multiples of 5 minutes, even though they were actually being executed at all times. Presumably, if that is the case, this must be a well known phenomenon that everybody using intrabar has experienced.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,401 since Apr 2013
Thanks: 431 given, 1,601 received

timfel,

this is expected behavior. The report will only show the ending timestamp of the bar, but the prices of the fills which could be intrabar.
The same goes for your code by the way. TS will not expose the intrabar times of a bar for timebased bars, but only the ending timestamp.

Regards,

ABCTG


timfel View Post
Yes I have used intrabar persist. What it appears on further investigation is that the trades are actually executing intrabar, but they were only being reported on bar close, which is why they were all at multiples of 5 minutes, even though they were actually being executed at all times. Presumably, if that is the case, this must be a well known phenomenon that everybody using intrabar has experienced.


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io Trading Community Platforms and Indicators TradeStation > Intrabar Order Generation not working


Last Updated on April 11, 2023



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts