Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am attempting to convert my strategy for use with Intrabar Order Generation, and have a 99% solution. I discovered a feature/bug/unexpected behavior I'm hoping someone understands and can explain.
I noticed that my indicators do not warm up during the maxbarsback period with IBOG on. Consequently, the first bar the strat starts trading the indicators are just starting out their life and don't have the correct values. I was able adjust for this by putting my order logic in the following begin.. end statement:
This works since smalength requires the most bars back in my indicators.
Anyone know why this happens, and how I can change it without the use of the above? Any help is appreciated!
You are using the correct approach. There are a couple of ways around it but here is a quick and easy one:
Condition 1 = Currentbar > smalength ;
If condition1 and
SMAFast crosses over SMASlow
buy next bar at market ;
Just add Condition1 to every entry and you are set.
Thanks for the reply!
That is another way of doing the same thing I've accomplished with the code I posted, but this sort of code isn't required with IBOG off, since that is the whole purpose of having to tell the platform a maxbarsback, and I don't understand why it is required with IBOG on. I don't like fully understanding how things are working, so I'm hoping you might have an explanation
That is another way of doing the same thing I've accomplished with the code I posted, but this sort of code isn't required with IBOG off, since that is the whole purpose of having to tell the platform a maxbarsback, and I don't understand why it is required with IBOG on. I don't like fully understanding how things are working, so I'm hoping you might have an explanation
I appreciate it!
Glad to help. Hopefully I don't totally mess up the explanation, but here goes.
Maxbarsback is merely a way of TradeStation having you, the user, help mitigate any memory problems caused by function, indicators, etc.. You don't want a runaway function that calculates back to the beginning of a data set, which may have 10-20 years or more of data. To my understanding, IBOG is not related to or dependent upon maxbarsback, and vice versa. Also, maxbarsback is not used to tell your strategy to not trade until it reaches that bar number. If your indicators require that many bars to generate a value, then you may not have any signals anyhow.
IBOG does not affect indicators, only strategies (don't confuse indicators with functions). The warm-up period, as you describe, is normal. For example, I use a 200 period moving average, so I set maxbarsback to 200 and set Currentbar > 200.
Your solution to the problem is the solution you have. Don't start trading until you have reached the minimum number of bars needed. Do this with the Currentbar >, my suggestion, or using start dates as a condition in your strategy code.... there are a number of solutions that will work. Without seeing your code, I can only take a guess, but what I suggest will be your best practice.
If you are getting two different values from the same calculation, then troubleshoot using print statements in your code.
If you need a more technical explanation, I would visit the TradeStation community forum and ask the question. The engineers may give a more detailed and technically correct explanation. For now, if the given solution works, then just take it and run with it.
So I think I said all of this to say: it's a feature.