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

[amibroker] Re: Questions about the Equity() function



PureBytes Links

Trading Reference Links


Tomasz answered with the following on the beta thread (where I'd 
accidently posted this same question):
"
Hello,

Equity needs a SYSTEM code to generate equity values.
So you have to include your SYSTEM (buy/sell statements) before equity
() call.

Built-in equity function does that by using
#include @LastBacktestFormula
..........
"
-------------------------------------------------
Okay, that makes sense but now I'm wondering if there is any way I 
can do what I was trying to do with the Equity function.

I'm trying to program a volatility based position sizing system that 
always has a minimum number of positions (say MinPos=5) and where the 
maximum position size never exceeds Equity()/MinPos (20% in this 
case). The  position sizing (NumShares) is defined to be some 
function (multiple) of RiskCapital/ATR().

(Yes, this is the same issue I was wrestling with a week or so ago).

At that time, somebody suggested setting PositionSize = Max(-20, 
NumShares*BuyPrice). After some thinking, though, I think this 
overrides the position sizing desired because if the 20% is exceeded, 
it just ignores the volatility based sizing and gets the maximum 
number of shares allowed by the 20%.

So what I was trying to do with Equity was to predetermine the number 
of shares I could buy for my risk and then making the 20% 
constraint part of my Buy criteria. Something like the following:

Buy = cond1 
  AND cond2 
  AND NumShares*Open < .20*Equity()
  ...

So if it fails that test, I just go find another stock that does work.

But if Equity doesn't work as I thought, does anybody know how to 
accomplish something like this?

Dan

--- In amibroker@xxxxxxxxxxxxxxx, "danielwardadams" 
<danielwardadams@xxxx> wrote:
> 
> Why doen't the following plot my equity line while the Equity graph 
> selectable from the AA window works fine?
> 
> Plot(Equity, "Equity", colorBlue, styleLine ) ;
> 
> Instead it just plots a flat line with the value I used for 
> InitialEquity (in SetOption).
> 
> Also, why aren't the following two things equivalent?
> 
> PositionSize = .20*Equity ;
> PositionSize = -20 ;
> 
> I've tried most variations of Equity parameters to no avail. 
> Obviously there's something about Equity() I don't understand. 
> Apppreciate any help.
> 
> Dan
> 
> (I apologize if a variation of this message appears twice. A lot of 
> times when I hit Send, it never makes it to the thread (??).





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/