I think you are wondering because setups on following bars overwrite the
first setup and therefore they are producing new "setup prices".


Thomas
www.patternexplorer.com


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of bernardedmond01
Sent: Wednesday, March 21, 2007 4:15 AM
To: [email protected]
Subject: [amibroker] Hold and Valuewhen functions

I wondered whether you could tell me where I'm wrong with this basic 
formula. I want it to hold my setup for 5 bars and then buy once the 
high is more than 15% higher than the setup price. I'm having 
difficulty with the hold and value when functions.
Thanks in advance.

Setup = C<BBandBot (C,20,2);
Buyzone= Hold(Setup,5); //What I'm trying to say here is once I have a 
setup, hold it up to 5 periods//
SetupPrice = ValueWhen (Setup,H); //What I'm trying to say here is the 
setup price is the high of the setup//
Buy = Buyzone AND H>SetupPrice*1.15;
Sell = 0;

Reply via email to