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

No it is not, was: Re: [amibroker] Re: IS THIS A BUG: Strange things with Backtester



PureBytes Links

Trading Reference Links

Hello,

If you send your post with all UPPER CASE in the *subject* line
it means that you are shouting. It is considered offensive (not merely a question).

Also do not truncate responses from the thread, otherwise
it is hard to keep track of the history.

To the matter:

You could use static variable (see code below) BUT this is not the point....
you still do not understand that there are *two* passes.
First pass executes formula once for every symbol under test,
then second pass executes once for portfolio equity.
If you use the code below you will get the value for last symbol under test.
Please re-read what I wrote in previous response. 

You would need to move the logic you are trying to implement
INSIDE custom backtest procedure and openpos.Symbol to
know which symbol is used for given trade.

Anyway: you should describe *final goal* you want to achieve,
not tiny coding bits because beginners often choose wrong path.

Last but not least: you should send it to tech support instead.

Best regards,
Tomasz Janeczko
amibroker.com



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

   bo.Backtest();

  bo.AddCustomMetric("commission", StaticVarGet("mystaticvar")); 
}
else
{
 brokercom = IIf(StrFind(Name(),"GBP.USD"),20,5);
 StaticVarSet("mystaticvar", brokercom );
}
Buy=1;
Sell=1;
Short =1;
Cover=1;

----- Original Message ----- 
From: "dralexchambers" <dralexchambers@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, May 30, 2007 4:06 PM
Subject: [amibroker] Re: IS THIS A BUG: Strange things with Backtester


> There was NO judgement intended - merely a question - I am not an 
> experienced programmer.
> 
> Thanks for the link.
> 
> Is there a way that I can set my "brokercom" variable correctly for 
> GBP.USD in the custom backtest? AFL code would be really helpful.
> 
> Alex
> 
> 
> 
> Please note that this group is for discussion between users only.



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/