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

[amibroker] Re: track your past performance of your portfolio using AFL and portfolio-equity



PureBytes Links

Trading Reference Links

now i manage to "code" my trade-list and now i'm able to see all my past-history of portofolio-equity, cash and drawdown.  all i have to do is 'backtest'  my afl and after that call 'portofolio-equity'.

here is my code so far:

SetOption("InitialEquity", 50000);
SetOption( "CommissionMode", 1);
SetOption( "PriceBoundChecking", False );
SetTradeDelays( 0, 0, 0, 0 );
SetOption("MaxOpenPositions", 99999 );
CommPerc = 0;
SetOption( "CommissionAmount", CommPerc) ;

BuyCondition  = False; 
BuyPrice = 0;

ps  =    (Name()=="BRK" AND DateNum()==1051222)* 2000;
BuyCondition  = BuyCondition +  (Name()=="BRK" AND DateNum()==1051222);
BuyPrice = BuyPrice + (Name()=="BRK" AND DateNum()==1051222)* 2.92;

ps  = ps   + (Name()=="OLT" AND DateNum()==1051221)* 7000;
BuyCondition  = BuyCondition  +  (Name()=="OLT" AND DateNum()==1051221);
BuyPrice = BuyPrice  + (Name()=="OLT" AND DateNum()==1051221)* 0.38;

ps  = ps  + (Name()=="BRD" AND DateNum()==1051223)* 500;
BuyCondition  = BuyCondition  +  (Name()=="BRD" AND DateNum()==1051223);
BuyPrice  = BuyPrice  + (Name()=="BRD" AND DateNum()==1051223)* 13.9490;

ps  = ps   + (Name()=="SNP" AND DateNum()==1051223)* 5000;
BuyCondition  = BuyCondition +  (Name()=="SNP" AND DateNum()==1051223);
BuyPrice  = BuyPrice  + (Name()=="SNP" AND DateNum()==1051223)* 0.4801;

//...

SetPositionSize( ps, spsShares );

Buy= IIf ( BuyCondition, sigScaleIn,0 );

Sell=False;

any suggestion or comment is welcomed !!!

btw, my question still stands: "how you people track your past performance of your portfolio ?"

am i on the right direction or there are other better ways to do it ... ?

thanks in advance !

 

 


--- In amibroker@xxxxxxxxxxxxxxx, "mvc2407" <mvc2407@xxx> wrote:
>
> hi,
>
> i'm not so advanced in AFL, but i want to code somehow manually all
> my executed (in the past) trades to can see, using EQUITY, the graph
> of my Portfolio Equity (cash, drwdaw, etc...)
> i start with something like:
>
> ---------
> SetOption("InitialEquity", 100000);
> SetOption( "CommissionMode", 1);
> SetOption( "CommissionAmount", 1) ;
> SetOption( "PriceBoundChecking", False );
>
> ps = (Name()=="SNP" AND DateNum()==1060110)*10000 + (Name()=="BRD"
> AND DateNum()==1060206)*5000;
> SetPositionSize( ps, spsShares );
>
> BuyPrice = (Name()=="SNP" AND DateNum()==1060110)*0.8 + (Name()
> =="BRD" AND DateNum()==1060206)*0.163;
> Buy = (Name()=="SNP" AND DateNum()==1060110) + (Name()=="BRD"
> AND DateNum()==1060206);
> Sell=False;
> ---------
>
> where i tried to code only 2 trades for the begining.
> unfortunately, the above piece doesn't reveal any trade when I
> backtested it in AA window :(
> even if I explored it the 'buy' events occured corectly (after i add
> Filter=1; AddColumn.. stuff)
> i don't know what i did wrong, but i'm sure somebody can help me.
> btw, how did u people track your past performance of your portfolio
> using AFL and portfolio-equity?
> thx in advance for your answers!
>



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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS