NexusFi: Find Your Edge


Home Menu

 





IntrabarOrderGeneration and current OHLC?


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #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?
Seeking Insights on Day Trading Options on Futures
Options
NinjaTrader indicator for last bar percentages
NinjaTrader
RSI Values Scale
NinjaTrader
Anyone Trading Equities using NT8?
NinjaTrader
Creating global variables for Ninjatrader
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Fighting Addiction and Stops
17 thanks
Big Mike in Ecuador
6 thanks
Just another trading journal: PA, Wyckoff & Trends
6 thanks
Crossing the Abyss: An Adventure Guide by Snax
4 thanks
Want your NinjaTrader indicator created, free?
4 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634


Hi Form9,

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

Regards,

ABCTG

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


ABCTG View Post
Hi Form9,

welcome to NexusFi. 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,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634

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
Thanked by:
  #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,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634

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
Thanked by:
  #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
Thanked by:
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634

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 - Sitemap - Downloads - Top
no new posts