Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, Quad, PeWi), 488 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error 046 debugging help #452329
06/09/15 16:09
06/09/15 16:09
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi jcl. I'm getting Error 046 and would appreciate some debugging clarifications/suggestions:

a) The manual reports this error as "Error 046: LookBack exceeded" but I am experiencing "Error 046: IDX LookBack exceeded by <n> bars". Does the addition of "IDX" to the message provide any more information?

b) The error is popping up _between_ runs, as determined by printf's at the very start and very end of the run function. There is no tmf involved. Any suggestions how to track down this error given that it's getting triggered within the Zorro code that I can't see?

c) The popup provides Abort, Retry, and Ignore buttons. The progress bar has gone ~80%. Abort produces the summary stats in the window (Profit, #Trades, AR, etc.) but no chart. Is that correct? Shouldn't Abort just stop everything then & there? Retry and Ignore produce an Error 030, do not print the summary, do plot a chart, and in the log is a final trade entry message that does not appear if Abort is pressed. Do these differences provide any clues?

Thanks.

Re: Error 046 debugging help [Re: DdlV] #452398
06/11/15 11:12
06/11/15 11:12
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I believe "IDX" means that a function that takes an index, such as price() or day(), exceeds the lookback. And this not in the first run but somewhere else, so you're modifying the offending index somewhere in your script. Hope this helps.

Normally you need not debug it, but just increase LookBack.

What happens after "Abort" depends on your script. If it has collected some trades, then you'll see that in the exit message.

Re: Error 046 debugging help [Re: jcl] #452406
06/11/15 12:39
06/11/15 12:39
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks jcl. Increasing LookBack did resolve the issue, but I believe I had a misunderstanding as follows.

It seems the price() functions are implemented as series of length LookBack? In other words, my strategy was not attempting to look earlier than the 1st LookBack bar. It was at a later point in time attempting to get price(n), with n>LookBack. This price(n) is a price that the strategy has already encountered after lookback, so I expected it to be available.

The manual does not say the offset for the price() functions needs to be <=LookBack, but this appears to be the case.

I had assumed the price() functions could retrieve all available price data in the History folder, but this appears not to be the case.

Thanks.

Re: Error 046 debugging help [Re: DdlV] #452415
06/11/15 13:49
06/11/15 13:49
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
All looks into the past must be <= LookBack at any time, because that is the very purpose of the LookBack variable.

Sure, you're right that in the backtest it would not matter because you have access to the whole price curve. But I suppose you'd run into a problem when you tried to trade that live.

Re: Error 046 debugging help [Re: jcl] #452417
06/11/15 14:59
06/11/15 14:59
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks jcl.

To clarify, my issue was that the backtest does _not_ have access to the whole price curve. At any given bar, the backtest only has access to the past LookBack prices.

An example with arbitrary numbers:

LookBack=100. At Bar=4327, strategy attempts price(231). Fail. Even though the strategy has actually experienced and processed this old bar. Zorro just hasn't saved this data because 231>100.

Now that I understand it makes sense, because this way the strategy functions the same in both Test and Trade. It just wasn't obvious initially since all the History is there for the price() function to use in Test. I think explicitly adding to the price functions manual page that offset must be <=LookBack might help someone else in the future.

Thanks.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1