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

Re[2]: [amibroker] Re: UnKnown error msg: "Out of present range"



PureBytes Links

Trading Reference Links

Title: Re[2]: [amibroker] Re: UnKnown error msg: "Out of present range"

thank you... however I don't use PositionSize statements.


Also, and this is strange, the problem disappeared. I cannot replicate it anymore. The code worked fine for several weeks, then I had a few days that the error occurred (at random times/tickers), and now it is gone. The code and EOD data wasn't changed - I didn't even shut down my computer. 


herman



Friday, November 14, 2008, 1:17:53 PM, you wrote:


> Hi.


> I had this problem fixed just yesterday. The problem was triggered by 

> the following line:


>    PositionSize = (pct_equity * -1) * (BuyPrice / Stop);


> (As you can see, I use fixed percent risk model.)


> Notice that depending on the value of the Stop variable, the formula 

> above can generate large PositionSizes, i.e. values much less that -100.

> So the fix was simple:


>    PositionSize = Max(-100, (pct_equity * -1) * (BuyPrice / Stop));


> The problem manifested itself on CBT when doing some math using 

> sig.PosSize, *even if I range-check the variables in the CBT proc*.


> Also, the popup didn't appear if I temporarily commented out the CBT 

> proc, even without the fix above.


> To me, it looks like this problem is CBT-related, *BUT* I suggest you to

> check all your AFL code for range problems.


> Hope it helps.


> Herman escreveu:

>> Thanks again Paul,



>> Do you remember how you fixed the problem? Or did it just disappear? 



>> The CBT code worked fine for weeks. The error is erratic. 



>> herman




>> Friday, November 14, 2008, 3:54:31 AM, you wrote:



>>>  Hi Herman


>>>  I just checked my correspondance with AB support last time I faced 


>>>  this error.



>>>  The message to Support was



>>>  "I have undergone some more tests and discovered that the "Out of


>>>  Present range" error come from the condition that if there is one 


>>>  and only one trade is generated in a backtest for any one of symbols 


>>>  in the watchlist selected."



>>>  This problem was solved in later updates, so it wouldnt apply to 


>>>  you, but Marcin's explanation of the error message is instructive.



>>>  Marcin's reply



>>>  Hello,



>>>  Basically - in AmiBroker itself string like "Out of present range" 


>>>  does not exist.



>>>  It may come from Microsoft OLE automation libraries when 


>>>  DISP_E_OVERFLOW exception occurs (according to Tomasz, who has 


>>>  searched all the system libraries, for that string and it occurs 


>>>  only in OLE libs).



>>>  This occurs when external program or script calls OLE functions with 


>>>  incorrect arguments (most probably uses incorrect type of the 


>>>  argument, as according to Microsoft DISP_E_OVERFLOW occurs when One 


>>>  of the arguments passed could not be coerced to the specified type)



>>>  So I'll say check all your OLE calls.


>>>  Cheers.


>>>  Paul.




>>>  ------------------------------------



>>>  **** IMPORTANT ****


>>>  This group is for the discussion between users only.


>>>  This is *NOT* technical support channel.



>>>  *********************


>>>  TO GET TECHNICAL 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



>>>      http://groups.yahoo.com/group/amibroker/



>>>      Individual Email | Traditional



>>>      http://groups.yahoo.com/group/amibroker/join


>>>      (Yahoo! ID required)



>>>      mailto:amibroker-digest@xxxxxxxxxxxxxxx 


>>>      mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx



>>>      amibroker-unsubscribe@xxxxxxxxxxxxxxx 

>> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx>



>>>      http://docs.yahoo.com/info/terms/







__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___