NexusFi: Find Your Edge


Home Menu

 





IntrabarOrderGeneration and current OHLC?


Discussion in EasyLanguage Programming

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




 
Search this Thread

IntrabarOrderGeneration and current OHLC?

  #1 (permalink)
Form9
PHOENIX AZ
 
Posts: 5 since Nov 2018
Thanks Given: 3
Thanks Received: 1

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;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
62 thanks
NexusFi site changelog and issues/problem reporting
46 thanks
Battlestations: Show us your trading desks!
34 thanks
GFIs1 1 DAX trade per day journal
31 thanks
What percentage per day is possible? [Poll]
22 thanks

  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


Hi Form9,

welcome to futures.io. What resolution do you use for the look inside bar backtesting?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
  #4 (permalink)
Form9
PHOENIX AZ
 
Posts: 5 since Nov 2018
Thanks Given: 3
Thanks Received: 1


ABCTG View Post
Hi Form9,

welcome to futures.io. What resolution do you use for the look inside bar backtesting?

Regards,

ABCTG

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.

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Form9,

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

Regards,

ABCTG


Form9 View Post
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.


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
  #6 (permalink)
Form9
PHOENIX AZ
 
Posts: 5 since Nov 2018
Thanks Given: 3
Thanks Received: 1

OK it's still showing the Low and Close as the Low.

I'm on a 15 minute chart backtesting 10 years. My resolution is 1 Minute and Maximum number of bars study will reference: 200.

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Form9,

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.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
  #8 (permalink)
Form9
PHOENIX AZ
 
Posts: 5 since Nov 2018
Thanks Given: 3
Thanks Received: 1


ABCTG View Post
Form9,

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.

Regards,

ABCTG

OK hold on, now TS won't stop crashing.

Edit: My entire TS is corrupted, I'll have to re-install when I get the time. Thanks for all your help!

Reply With Quote
The following user says Thank You to Form9 for this post:
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Form9,

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

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #10 (permalink)
Form9
PHOENIX AZ
 
Posts: 5 since Nov 2018
Thanks Given: 3
Thanks Received: 1


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.

Reply With Quote





Last Updated on November 19, 2018


© 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