IBOG Preventing MaxBarsBack Warmup - futures io
futures io



IBOG Preventing MaxBarsBack Warmup


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,243 views
    2. thumb_up 2 thanks given
    3. group 2 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
 

IBOG Preventing MaxBarsBack Warmup

(login for full post details)
  #1 (permalink)
Trader Kevin
Houston, Texas
 
 
Posts: 13 since Jun 2020
Thanks: 3 given, 4 received

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:
 
Code
if Currentbar > smalength then begin
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!

Reply With Quote
The following user says Thank You to Trader Kevin for this post:

Can you help answer these questions
from other members on futures io?
Multi Time Frame High/Low/Median levels
NinjaTrader
Market on Close data within IB
Platforms and Indicators
How do I create Strategy with the Second Entry indicator
NinjaTrader
How to pay for market data with Dorman LLC
NinjaTrader
help with take profit several targets
TradeStation
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
88 thanks
An embarrassing, honest confession
25 thanks
Sierra vs. Ninja : why I chose .....
8 thanks
ApexTraderFunding.com experience and review
8 thanks
Want your NinjaTrader indicator created, free?
7 thanks
 
(login for full post details)
  #2 (permalink)
 vmodus 
Legendary Systematic Algo Trader
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
 
vmodus's Avatar
 
Posts: 1,263 since Feb 2017
Thanks: 2,958 given, 2,842 received


Trader Kevin View Post
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:
 
Code
if Currentbar > smalength then begin
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:

 
Code
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.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #3 (permalink)
Trader Kevin
Houston, Texas
 
 
Posts: 13 since Jun 2020
Thanks: 3 given, 4 received



vmodus View Post
You are using the correct approach. There are a couple of ways around it but here is a quick and easy one:

 
Code
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

I appreciate it!

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 vmodus 
Legendary Systematic Algo Trader
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
 
vmodus's Avatar
 
Posts: 1,263 since Feb 2017
Thanks: 2,958 given, 2,842 received


Trader Kevin View Post
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

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.

I hope this helps.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to vmodus for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > IBOG Preventing MaxBarsBack Warmup


Last Updated on March 19, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



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