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

[amibroker] Re: Strange error message: "Außerhalb des Bereichs"



PureBytes Links

Trading Reference Links

Hello Tomasz,

thanks for your explanation. I have figured out now, that the error 
message ONLY appears when i use a custom backtest code. However it 
happens also when i use one of your examples from your help and it 
doesn't happen with another example from your help. I have also 
removed all plugins to assure that they are not the reason. Do you 
see any reason for this behaviour ?
I have listed the codes below:

1) The error appears with this code:

if( Status("action") == actionPortfolio ) 
{ 
	bo = GetBacktesterObject(); 
	bo.PreProcess();

	EquityArray = 0;     

	for(bar = 0; bar < BarCount; bar++) 
	{	 
	   	EquityArray[bar] = bo.Equity; 
		bo.ProcessTradeSignals(bar); 
	} 
	bo.PostProcess();
}


2) and also with this code from your help:

MaxLossPercentStop = 10; // 10% max. loss stop 

/* Now custom-backtest procedure follows */ 
if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 

    bo.Backtest(1); // run default backtest procedure 

   SumProfitPerRisk = 0; 
   NumTrades = 0; 

   // iterate through closed trades first 
   for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade
() ) 
   { 
       Risk = ( MaxLossPercentStop / 100 ) * trade.GetEntryValue(); 
       RMultiple = trade.GetProfit()/Risk; 

       trade.AddCustomMetric("Initial risk $", Risk  ); 
       trade.AddCustomMetric("R-Multiple", RMultiple  ); 

       SumProfitPerRisk = SumProfitPerRisk + RMultiple; 
       NumTrades++; 
   } 

    expectancy3 = SumProfitPerRisk / NumTrades; 

    bo.AddCustomMetric( "Expectancy (per risk)", expectancy3 ); 

    bo.ListTrades(); 

} 

3) but NOT with this code from your help:

if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 

    bo.Backtest(); // run default backtest procedure 

    st = bo.GetPerformanceStats(0); // get stats for all trades 

    expectancy = st.GetValue("WinnersAvgProfit")*st.GetValue
("WinnersPercent")/100 + 
                st.GetValue("LosersAvgLoss")*st.GetValue
("LosersPercent")/100; 

    bo.AddCustomMetric( "Expectancy ($)", expectancy ); 
} 


Kind regards
Thomas



--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@xxx> 
wrote:
>
> Hello,
> 
> The fact that there is a "AmiBroker" caption does NOT mean that it 
comes from
> AmiBroker.
> 
> The caption will be the same if error is inside the PLUGIN DLL
> or plugin uses AfxMessageBox() function. This is so because Windows 
applies
> APPLICATION name if any error occurs inside any DLL loaded by the 
application.
> 
> So, as I said: the error message does NOT come from AmiBroker 
because
> there is NOT a single line of German text in AmiBroker source code.
> 
> You should check your own plugins - best REMOVE them all and re-
check.
> 
> The other reason maight be OLE automation code (including custom 
backtester code)
> that you are using - referring to non-existing list/array items and 
such.
> If your OLE automation generates any general OLE exception then 
Windows will
> display localized text in the message box that has caption of the 
application name.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Thomas Z." <tzg@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, May 22, 2007 6:07 PM
> Subject: RE: [amibroker] Re: Strange error message: "Außerhalb des 
Bereichs"
> 
> 
> Hello,
> 
> yes, i am sure, please see my attached snapshot.
> 
> Furthermore it's strange that this problem only appears on 
backtests.
> 
> It also appears only on some symbols and at those symbols it 
appears only
> when I test the complete history.
> When I test for example the last 1300 bars than it makes no 
problem, when I
> set more bars than I get the error.
> The number of bars at which this behavior occurs is different at 
every
> symbol.
> 
> 
> Thomas
> www.patternexplorer.com
> 
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On Behalf
> Of Tomasz Janeczko
> Sent: Tuesday, May 22, 2007 4:26 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Re: Strange error message: "Außerhalb des 
Bereichs"
> 
> "Ferhalb_des_Bereichs" - are you sure that you are getting error 
message in
> GERMAN language?
> If so, it does not come from AmiBroker (there is not a single word 
in German
> in AB).
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Thomas" <tzg@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, May 22, 2007 3:39 PM
> Subject: [amibroker] Re: Strange error message: "Außerhalb des 
Bereichs"
> 
> Hello,
> 
> do you see any failure in my code ?
> I have reduced it as good as possible and deleted almost 
everything ?
> 
> Basically the code below is a part of my trading system. My system
> works fine when i use an ATR stop, but the problem appears when i
> replace my ATR stop with my ValueATnHHV() function.
> Thanks in advance !
> 
> function ValueATnHHV(Output,Array,period,n)//max. n = 7
> {
> ValueATnHighestHighArray = Null;
> 
> for( i = 0; i <= BarCount - Period; i++ )
> {
> ReturnValue = Null;
> for( j = i; j <= i + Period - 1; j++)
> {
> ReturnValue = Output[j];
> }
> // _TRACE("This is first element of close array: " +
> (i+period-1) + "Barcount" + BarCount);
> ValueATnHighestHighArray[i+Period-1] = ReturnValue;
> }
> 
> return ValueATnHighestHighArray;
> }
> 
> Kind regards
> Thomas
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@> wrote:
> >
> > typically your index in a loop is greated than the lat data point
> >
> > ----- Original Message ----- 
> > From: "Thomas" <tzg@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Tuesday, May 22, 2007 1:54 AM
> > Subject: [amibroker] Strange error message: "Außerhalb des 
Bereichs"
> >
> >
> > > Hello,
> > >
> > > i get a strange error message in germany language when i make a
> > > backtest. In english it means "out of range".
> > >
> > > Does anyone know what possible reasons could be for that 
message ?
> > >
> > > I have already contacted the amibroker support but got no reply.
> > > In the meantime i try to create a smaller code to make it able 
to
> > > reproduce because my current code is already very long.
> > >
> > > Kind regards
> > > Thomas
> > >
> > >
> > >
> > >
> > > 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
>




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/