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)
Noobie question regarding backtesting, but my research for finding an answer has come up short.
Under Format > Calculation I've checked Enable intrabar order generation and calculation
Then in my Strategy, if I try to print a previous candle's OHLC such as: Print(Open[1], " ", High[1], " ", Low[1], " ", Close[1]); it works fine.
But if I try to print the current candle's OHLC such as: Print(Open[0], " ", High[0], " ", Low[0], " ", Close[0]); it doesn't work; it prints the Open and the High correctly, but the Low and Close are both printed as the Low.
This problem carries over to my conditionals:
If Close < Low[10]
is being computed identically to
If Low < Low[10]
Earlier, the Open and High were both printing as the High as well, but that magically seems to have fixed itself.
I just need a way to either fix this problem, or ditch intrabar while backtesting altogether.
I'm only using it because it's the only way I've been able to get two targets working when my orders look like Sell Short ( !( "Shorting" ) ) 2 contracts next bar at Market;
Can you help answer these questions from other members on NexusFi?
OK this is really embarassing, my EL Ref Guide talks about the resolution, and where to find it. But the book is so old, that window isn't where it says it should be. I have Enable Intra-bar Order Generation Optimization with Look-Inside-Bar Back-Testing checked, but can't find anything on resolution.
Edit: Nevermind I found it. Let's see if this works.
the information in this link might be helpful in understanding why you are seeing a certain outcome, especially the second paragraph: About Intrabar Order Generation
I can take a look at what results, but I would need a working code example that shows the behavior on your end. I would also suggest checking if you are seeing this behavior on all bars or just some.
you are welcome and thank you for letting me know.
In general using intrabar order generation and the look inside bar backtesting it is possible to get different values for the Open, High, Low and Close of a bar.
Just printing the values for the 300 am EST bar on a 15 minute chart within an intrabar order generation strategy without using the look inside bar backtesting (LIBB) already provides different values:
11/19/2018 3:00:00 AM; Open = 2737.00; High = 2737.00; Low = 2737.00; Close = 2737.00
11/19/2018 3:00:00 AM; Open = 2737.00; High = 2737.00; Low = 2736.75; Close = 2736.75
11/19/2018 3:00:00 AM; Open = 2737.00; High = 2739.00; Low = 2736.75; Close = 2739.00
11/19/2018 3:00:00 AM; Open = 2737.00; High = 2739.00; Low = 2736.75; Close = 2738.50
The code however is only computed at the four price points (without LIBB) and that's why the value for Close will reflect the value of the price point that is currently used in the computation (High or Low for example).
Just wanted to give an update here for any future travelers.
While I was tinkering around trying to fix the problem, my v9.x TS crashed and got corrupted, and I couldn't load any strategies.
Instead of reinstalling x9.x or calling support, I opted to upgrade to v10.x. I was able to carry over all my indicators and strategies. And like magic, no more corruption AND my problem appears to be gone!
All I have checked is Enable Intra-bar Order Generation Optimization with Look-Inside-Bar Back-testing.
I'll edit and update this post if it is, in fact, still broken or breaks again.