Hi again…
I found the problem to be that the equity()
function will only work if placed after the buy/sell signals.
Problem is that I need it before the buy
signal in order to calculate the position size.
Anybody can indicate a way to determine
the equity value before the buy signal??
Thanks in advance for any input.
Claude
From:
Claude Caruana [mailto:claudecaruana@xxxxxxxxxxx]
Sent: Tuesday, February 15, 2005
13:12
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Risk
compounding with gains - problem
Hi All,
Can anybody help me with this? I am trying to achieve a
position sizing technique where half the current total profit (assuming there
is a profit) is re-invested into risk. Problem is that it seems like equity(0) is
always returning 250000 and the CurrentPL variable seems to always be 0.
StartCapital = 250000;
CapitalNow = equity(0);
CurrentPL =
((CapitalNow-StartCapital)/StartCapital);
RiskPerTrade = 0.001+(CurrentPL/2);
PositionSize = ((CapitalNow*RiskPerTrade) / stopPoints) * BuyPrice;
What I am expecting this to do is: let us say at one point
the equity goes up 2% from 250,000 to 255,000 – then:
Current PL =
255000-250000/250000 = 0.02
RiskPerTrade = 0.001+(0.02/2) =
0.011
Risk per trade now should go up from 0.001 to 0.011, but
this isn’t happening.
I am aware I need to arrange this to handle losses, but I
first would like to sort out this issue.
Should I in fact be using equity(0) to achieve this or
should I be using some other function?
Thanks in advance for any help J
Claude
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor |
|
|
Yahoo! Groups Links