PureBytes Links
Trading Reference Links
|
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: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of matrix10014
Sent: Sunday, August 06, 2006 12:21
To: amibroker@xxxxxxxxxxxxxxx
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
|