You are mixing loop code with ApplyStop (array code).

If your loop does what you wish, then just put this line BEFORE the loop
(not inside the loop) and run an optimize:

Maxstop = Optimize( "maxstop", 10, 2, 30, 1);

--
Terry
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of matrix10014
Sent: Sunday, August 06, 2006 12:21
To: [email protected]
Subject: [amibroker] max stops and looping

Hi,

I am coding a max stop loss in my code which involves looping
I coded..
---------------------------------------------------------------------
-
if (Low[i]<=(1-Maxstop*.01)*priceatbuy)
        {
        exit = 4;
         SellPrice[i]=Min(Open[i],(1-Maxstop*.01)*priceatbuy);
         //My attempt to code in a Max stop loss-appears to work as 
coded
       }
--------------------------------------------------------------------
I am attempting to optimise "maxstop"
I did initialize   

Maxstop=10;//in percent

Am i correct that all I need to do is then code

ApplyStop(stopTypeLoss, stopModePercent, Optimize( "maxstop", 10, 2, 
30, 1 ), True ); 


Sorry,but I am just getting the hang of looping











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

 
Yahoo! Groups Links



 




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

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to