From:
Claude Caruana [mailto:claude.caruana@xxxxxxxxxxxxxxxxxxxx] 
Sent: Thursday, February 17, 2005
09:56
To: 'amibroker@xxxxxxxxxxxxxxx'
Subject: RE: [amibroker] Risk
compounding with gains - I cannot get round it
 
 
Hi all,
 
I’m finding real problems with
implementing this so I would really appreciate if there is somebody out there
with the answer!
The key is that I want my risk to be
relative to current total equity, not position size.
 
I understand if I use 
Positionsize = -20 , then my position size
is 20% of my current equity. Tried and tested – this works ok.
BUT,
If only I can assign a percentage of the
current equity to a variable other than positionsize, it would solve all my
problems – something like
CurrentEquity = XXXXX
 
Can anybody help? I would be really
grateful!
Thanks,
Claude
 
 
 
From:
Claude Caruana [mailto:claudecaruana@xxxxxxxxxxx] 
Sent: Tuesday, February 15, 2005
23:23
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Risk compounding
with gains - problem
 
 
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