[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Error Message Out of Present Range



PureBytes Links

Trading Reference Links

I have had a good learning experience getting to the bottom of this 
one.  Using the tip from Tomasz that it was an OLE interface error, I 
set about to figure out what it could be.

I didn't realize it at the time, but using the CBT amounts to using 
the OLE interface.  So, I learned how to use _TRACE and Dbgview to 
see what was going on.

I found that the Debugger output stopped on the 56th step of the 
closed trade loop in my expectancy calculation in my CBT Custom 
Metrics code.  Then, going back to the trade by trade output from the 
backtester I found the culprit - about 57 lines in.

There was a trade that was showing a % change of "-1.#J%" and a % 
profit of "-1.#J%", a value that was being retrieved via the OLE 
interface and generating the "Out of present range" error.

So, problem solved - sort of.  Now I have to get to the root cause of 
what is generating the "-1.#J%" result.  My first clue is that the 
exit price is showing as "-1.#IND", and upon further investigation, I 
have determined what causes this, but I have not had a chance to 
research the archives to see if anyone has already been down this 
path.

Anyway, the "-1.#IND" exit price gets generated under the following 
conditions:
 1) using rotational mode with positions held = 3 (just an example)
 2) worst held rank set at 4 (can be other number)
 3) re-entry delay after stop loss > 2 days
 4) stop-loss hit for multiple (2 or more) current positions
 5) positions hitting stop are still in top-4 ranking
 6) not enough valid positions to allow new fills because "worst rank 
held" is at 4 and re-entry delay does not allow rentering the 
positions that were just stopped out.  When this happens, one of the 
trades that occur in that vacinity receive an exit price of "-1.#IND" 
and the other dominoes start falling.

If this hasn't been addressed before, then I will likely move this to 
a new thread.


--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@xxx> 
wrote:
>
> Hello,o
> 
> Out of present range does not come from AmiBroker actually.
> 
> It is standard OLE interface error. It may occur if you are using 
OLE interface
> and trying to assign value outside -2^31 .... 2^31 to an integer 
field.
> 
> Somewhere in your formula you may be doing such assignment
> and it is likely the reason.
> If not, you would need to send the formula to support.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Ron Rowland" <rowland@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Saturday, January 12, 2008 7:55 PM
> Subject: [amibroker] Re: Error Message Out of Present Range
> 
> 
> >I have upgraded to 5.03 but error still occurs.
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> 
> > wrote:
> >>
> >> Hello,
> >> 
> >> Please upgrade to 5.03
> >> 
> >> Best regards,
> >> Tomasz Janeczko
> >> amibroker.com
> >> ----- Original Message ----- 
> >> From: "Ron Rowland" <rowland@>
> >> To: <amibroker@xxxxxxxxxxxxxxx>
> >> Sent: Saturday, January 12, 2008 6:30 PM
> >> Subject: [amibroker] Re: Error Message Out of Present Range
> >> 
> >> 
> >> >I am now getting the "Out of Present Range" error message while 
> >> > trying to run an optimization.  I'm running Beta 5.01.  
> >> > 
> >> > The error occurs about the 12th step.  When I run individual 
> >> > backtests using the same parameters it runs without errors.
> >> > 
> >> > Setting the date range to a small 2-3 year window also seems 
to 
> > help. 
> >> > 
> >> > The watchlist I am running against contains many composites if 
> > that 
> >> > has any bearing.  The composites have not been updated since 
> > October 
> >> > 2007, but I am specifying a range that ends well before then.
> >> > 
> >> > I have not been able to find any other info on this error 
except 
> > this 
> >> > post from Graham from May 2007 which appears to have received 
no 
> >> > replies.
> >> > 
> >> > --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@> wrote:
> >> >>
> >> >> Trying backtest (on all quotations) got a message window 
> > popup  "Out
> >> >> of Present Range"
> >> >> No other identifier and I could not see it in the error list 
in 
> > help
> >> >> 
> >> >> -- 
> >> >> Cheers
> >> >> Graham
> >> >> AB-Write >< Professional AFL Writing Service
> >> >> Yes, I write AFL code to your requirements
> >> >> http://www.aflwriting.com
> >> >>
> >> > 
> >> > 
> >> > 
> >> > 
> >> > Please note that this group is for discussion between users 
only.
> >> > 
> >> > To get support from AmiBroker please send an e-mail directly 
to 
> >> > SUPPORT {at} amibroker.com
> >> > 
> >> > For NEW RELEASE ANNOUNCEMENTS and other news always check 
DEVLOG:
> >> > http://www.amibroker.com/devlog/
> >> > 
> >> > For other support material please check also:
> >> > http://www.amibroker.com/support.html
> >> > 
> >> > Yahoo! Groups Links
> >> > 
> >> > 
> >> > 
> >> > 
> >> >
> >>
> > 
> > 
> > 
> > 
> > Please note that this group is for discussion between users only.
> > 
> > To get support from AmiBroker please send an e-mail directly to 
> > SUPPORT {at} amibroker.com
> > 
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> > 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> >
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/