PureBytes Links
Trading Reference Links
|
Stephane,
Here's how I think it would go:
Capital = 100000;
Risk = 0.01*capital;
Buycond1 = entry condition; //initial buy condition
BP1 = valuewhen(buycond1,open); //1st buyprice
PS1 = (risk/2*ATR(10))*BP1; //1st positionsize
Buycond2= ATR(10) + BP1;//2nd buy condition
BP2 =valuewhen(buycond2,open);//2nd buyprice
PS2 = (risk/2*ATR(10)*BP2;//2nd positionsize
Buycond3=ATR(10) + BP2;//3rd buy condition
BP3=valuewhen(buycond3,open);//3rd buyprice
PS3=(risk/2*ATR(10)*BP3;//3rd positionsize
etc. for buycond4 and buycond5;// continue for addition add-ons
Buy = buycond1 OR buycond2 OR buycond3 OR buycond4 OR buycond5;
I have not had a chance to test this code yet. Is it logical? What
about excess buy signals? Would you have to use RemBuy.dll?
Al V.
--- In amibroker@xxxx, "nenapacwanfr" <nenapacwanfr@xxxx> wrote:
> It seems the backtester takes one entry and one exit
> and the profit is calculated for LONG with
> ((ExitPr/EntryPr1)-1)*Positionsize
>
> if you take adding position
> that means
> you'll have multiples
> ((ExitPr/EntryPr2)-1)*Positionsize
> ((ExitPr/EntryPr3)-1)*Positionsize
>
> if you want to be right that means you must solve an equation to
> know what would be the right position size at entryPr1 if all the
> adding position have been taken.
>
> Hmmm!
>
> stephane
|