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

Re: [amibroker] target system tester



PureBytes Links

Trading Reference Links

Dear Stephane,

Let me point out some important issues:

> Buyprice= Buy*close; {in case of buy on the close}
This works only because buy is boolean and "true" equals to "1"
in AFL, but generally speaking you should avoid such constructs.
If you want to set buyprice to close use just
buyprice = close;
(in fact you don't need that because you can set it in Settings window)


>Target= valuewhen(buyprice, buyprice+3*atr(20),1) ;
>Exittarget=(ref(H,-1)<target and H>target)*target;
The first thing is that you use valuewhen not properly, correct usage is:

Target = 3 * atr( 20 ) + valuewhen( buy, buyprice ); 
// get buyprice when buy signal occurred and add 3 atrs to it

Now it is imporant to distinguish between triggering sell (via boolean sell variable) and setting actual sell price:
First thing is realized by:
sell = ref( H, -1 ) < target and H > target;

Setting sell price is done by the following line:
sellprice = target;

As you can see in AFL you control the bar when trade is made and the trade price separately.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com

----- Original Message ----- 
From: Stephane Carrasset 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Thursday, June 14, 2001 6:37 PM
Subject: [amibroker] target system tester


Tomacz,


As I said the system tester is a Great Tool.

Second Question for profit target:

With an example

I have a buy signal( never mind a buystop order or a buy on the close)
But I can know my Buyprice.

Buyprice= Buy*close; {in case of buy on the close}

Now I want to fix my target ( not with a percent ) but with ( for 
example) the atr.

Target= valuewhen(buyprice, buyprice+3*atr(20),1) ;
Exittarget=(ref(H,-1)<target and H>target)*target;

At what price will be the exit in the system tester
if the target is reached:
- the close or
- the price of the target ?

Stephane carrasset









Yahoo! Groups Sponsor



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.