PureBytes Links
Trading Reference Links
|
I added the SetForeign call and the HV formula still does not work.
Is this something that I need to calculate manually?
Any more help?
Thanks,
Cey
--- In amibroker@xxxxxxxxxxxxxxx, "Paul Ho" <paultsho@xxxx> wrote:
> the problem is with this line "HVtrade = 100*
> StDev(log(C/Ref(C,-1)),100)*sqrt(250);
> you need to get the trade symbol and then use foreign to get the
price array
> before doing your calculaltion
>
> Paul Ho
>
>
>
>
> _____
>
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On Behalf
> Of C Alvarez
> Sent: Saturday, 18 June 2005 4:21 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Custom Trade Metrics
>
>
> I am trying to add the custom metric of what the Historical
> Volatility was when the trade was entered.
>
> I tried the following code, but all I get are blanks. Do we not
have
> access to the price arrays? Or what am I doing wrong?
>
> Thank you,
> Cey
>
> Here is the code:
> SetCustomBacktestProc("");
> if( Status("action") == actionPortfolio )
> {
> bo = GetBacktesterObject();
> bo.Backtest(1);
> for(trade=bo.GetFirstTrade(); trade; trade=bo.GetNextTrade())
> {
> HVtrade = 100* StDev(log(C/Ref(C,-1)),100)*sqrt(250);
> trade.AddCustomMetric("HV", HVtrade);
> }
> bo.ListTrades();
> }
>
>
>
>
>
> 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 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/
>
>
> * To unsubscribe from this group, send an email to:
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .
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 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/
<*> 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/
|