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

[amibroker] Portfolio Equity - AB version 5.16



PureBytes Links

Trading Reference Links

Having trouble with Portfolio Equity function
 
The code below works OK if I use Equity(0,0);
 
It does not work if I use Foreign("~~~Equity",C");  No trades are detected.
 
 

StartEquity = 100000;

SetOption("InitialEquity", 100000);

SetOption("MinShares",100);

Max_Pos = 30;

SetOption("MaxOpenPositions",Max_Pos);

RoundLotSize = 10;

PointValue   = 1;

//

 

//Compute Positions and position size

Port_Equity   = Equity(0,0);                         // <<<< ==== This works OK

Port_Equity   = Foreign("~~~EQUITY()","C");          // <<<< ==== This does not work

Positions_    = Port_Equity  / 10000;

Positions     = IIf(Positions_ > Max_pos,Max_pos,Positions_);

SetPositionSize(Port_Equity/Positions,spsValue);

 

Thanks

 

Ara

__._,_.___

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




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

__,_._,___