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

Re: [amibroker] Re: Formula



PureBytes Links

Trading Reference Links


Hi Dimitris,
 
Thanks very much for your help.
Yes you are right.
In fact I'm trying to adapt some idea coming from a 
very interesting book called "Trading Systems that Work" from Tomas 
Stridsman.
But everything is in EasyLanguage which with I am 
not familiar. I have downloaded a free help of this language and now I try to 
build some given exploration in AFL.
 
The original formula is
Prof = 1 + PositionProfit(1) / EntryPrice(1) * 
BigPointValue;
CumProf = CumProf * Prof;
I understand this code together with the 
explanation in the book that the idea is to build a percentage return and then a 
geometric compounded return.
 
I send a note to the author and I understand now as 
follow:
 
Profit = SellPrice / BuyPrice
CumProfit = Ref(CumProfit, -1) * 
Profit
 
For example if you have two trades, one winner of 
10% and one loser of -10% starting from 100 I will have
Trade 1 : Profit = 1.1
Trade 2 Profit = 0.9
CumProfit = 1.1 * 0.9 = 0.99
which means 100 * 1.1 = 110 then 110 * 0.9 = 99 and 
99 / 100 = 0.99.
 
Thanks for your help.
 
Bernard Bourée<A 
href="">bernard@xxxx
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
DIMITRIS 
TSOKAKIS 
To: <A title=amibroker@xxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Wednesday, August 15, 2001 2:15 
PM
Subject: [amibroker] Re: Formula
Bernard,a.P = 1 + (SellPrice - BuyPrice) / 
BuyPrice;is EXACTLY equivalent 
toP=SellPrice/BuyPrice;becauseP=1+(S-B)/B=(B+S-B)/B=S/Bb. 
What is CP in words?This will help perhaps to continue.If I take 
verbatim theCP = CP * P;meansCP-CP*P=0, IECP*(1-P)=0, 
IEeither CP=0 or P=1Better say what is CP in words.Dimitris 
Tsokakis--- In amibroker@xxxx, Bernard Bourée <bernard@xxxx> 
wrote:> Hello,> > I have the following code:> 
> P = 1 + (SellPrice - BuyPrice) / BuyPrice;> CP = CP * 
P;> > > CP need to be initialised to 1.> How can I 
do that. If I code > CP = IIF( Cum(1) == 1, 1, CP);> I have an 
error since CP is unknown and should not be placed in the right part of 
the formula since is still not defined.> > Someone has an idea 
?> > Thanks> Bernard Bourée> 
bernard@xxxxYour 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.