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)
So I've finished writing an algo for futures on TS using its Easylanguage. I've backtested all the way up till Aug 31, 2016 (I think that's as far as it goes) and I want to go live as soon as possible. Here's the thing: I turned on intrabarordergeneration …
I am trying to automate a strategy on TS using its EasyLanguage. Previously, I used intrabarordergeneration (IOG) and with a 5-minute backtesting, the results looked great but as mtzimmer1 suggested in the post above, I switched the resolution to 1 tick over a month, and the results were pretty disappointing. (This is because I am using 5-minute intervals and my positions last anywhere from 5 min to 2 hours with an average of 50 minutes). I don't know if I am going to use IOG in the near future, and I understand that if I turn on IOG, the orders for entry/exit are placed at the next tick if the entry/exit conditions are satisfied. Something that I don't really understand from the description of IOG on the EasyLanguage page is the following:
If I have a moving average of the past 5 periods (5-minute intervals) and IOG is turned on, then how is it calculating the moving average? It is definitely not of the past 5 ticks, so is it taking each tick and then going back 5, 10, 15, 25 minutes and taking the average? If I am saying Close[1] is that the previous tick or the Close of the previous 5-minute bar?
Now, for my next question. So, I've turned IOG off except for my Stop Losses and Profit Targets. Every entry and exit that I have defined is executed
This Bar at Close
If IOG is turned off for entry/exit and I am running 5-minute intervals on my strategy, I would expect that back-testing at the 5-minute interval would not be much different than back-testing tick by tick except for slippage in my stop losses. Now, why is this completely wrong? I compare the back-testing and they are completely different. The 5-minute makes decent profit after commission over a few days while the tick by tick does not. Is this all slippage? It doesn't make sense for it to be this different since the backtesting should factor in High/Low for Stop Losses, right?
Can you help answer these questions from other members on NexusFi?
I'm not sure exactly why the difference in results is occurring but it usually has to do with how the strategy is coded. (What logic is used)
As far as the other question goes... IOG calculates the current price as the "close" until the bar itself actually closes. Say a five minute bar opens at 100.00. One minute in it has traded up to 100.24 and has satisfied the moving average condition; the order will be filled the moment the condition is met. We do not know what the close will be four minutes from now, and for that reason the tentative "close" is calculated as the last transacted tick.
I hope this answers at least half of your question.
Hi again Mr. Zimmer! Ah, so what you are saying is that with IOG on with your example (which my question is completely related to but I phrased terribly), when the moving average condition is satisfied, say at exactly 10:26:00 and for simplicity a simple moving average, the simple moving average calculation is (Price(10:26) + Price(10:21) + Price(10:16) + Price(10:11) + Price(10:06))/5, right?
I will check my strategy code again to see what the difference is, but you don't think slippage is the problem? I checked the first page of the trades list and I think the trades (time and position) were all the same in the 5-minute back-testing and the tick by tick except for the losses/profits.
Yes, I understand the weighting is equal, but I meant more along the lines of the following reasoning. With IOG on, the SMA is taking an average of values that are closer to the current time than with IOG off, where we have an average is spaced evenly by 5 minutes.
My experience with IBOG is limited, as years ago I found it did not backtest the way I though it should, and results were so puzzling at times I thought I'd lose my mind.
My hair stopped falling out (OK, more slowly fell out) once I gave up on IBOG...
Ahahaha, I think I am about to close the chapter that is IBOG. It seems like there is a huge potential with IBOG, but understanding the intricacies of it might not be worth it. Do you have any ideas as to why the back-testing for 5-minute is significantly different from the tick by tick when IBOG is only turned on for stop losses and profit targets?
Yes, you are completely right about the Print function (I am so used to having the Print results next to my code when I execute it that I completely ignore it when I'm on TS).