applystop does not work in a sell statement. It is used as a stand alone line
To make the exits variable you will need to define the actual exit conditions
If there are no excess buy signals after the entry one then you can simply use this as an example

Profit = IIf(ixic < MA(ixic, 20), 1.1, 1.7)/100;
sell = cross( C, valuewhen(buy,buyprice)*(1+Profit) );

this is extremely simplified and does not take into account any trade delays on entry
If you get many buy signals before an exit happens the you will probably need to use a loop to define your entry and exits

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 18/09/06, lapilia <[EMAIL PROTECTED]> wrote:
My system generates long trades only.  It has two exit rules.  The first rule is based on profit target stop and the second rule is based on N-bar stop.
 
The profit targets are the followings :
a)  When IXIC < MA(IXIC, 20), the profit target is 1.1%. 
b)  When IXIC > MA(IXIC, 20), the profit target is 1.7%. 
 
The N-bar stops are the followings :
a)  When IXIC < MA(IXIC, 20), the N-bar stop is 10. 
b)  When IXIC > MA(IXIC, 20), the N-Bar stop is 9. 
 
Unfortunately, I tried to code these exit rules but the result is not correct.  Could someone tell me what's wrong with my formula ?  Here it is :
 
Sell =  IIf(ixic < MA(ixic, 20), ApplyStop(1, 1, 1.1, 1, True ) and  ApplyStop (3, 1, 10, 1, True ), ApplyStop(1, 1, 1.7, 1, True ) and  ApplyStop(3, 1, 9, 1, True ));
 
 
Thanks
 
Claude Marc-Aurèle




__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to