NexusFi: Find Your Edge


Home Menu

 





IBOG Preventing MaxBarsBack Warmup


Discussion in EasyLanguage Programming

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




 
Search this Thread

IBOG Preventing MaxBarsBack Warmup

  #1 (permalink)
Trader Kevin
Houston, Texas
 
Posts: 13 since Jun 2020
Thanks Given: 3
Thanks Received: 5

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
Thanked by:

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


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 NexusFi Trade Journal Reply With Quote
  #3 (permalink)
Trader Kevin
Houston, Texas
 
Posts: 13 since Jun 2020
Thanks Given: 3
Thanks Received: 5



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
  #4 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


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 NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on March 19, 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