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

[amibroker] How to buy on multiple conditions?



PureBytes Links

Trading Reference Links

Hi-

I want to buy when four multiple buy setup conditions rise above a  
certain level after falling below a certain level. I can easily detect 
when these setup conditions are met (all below the level) at the same 
time with the  Buy statement below but I dont want to buy then. I want 
to buy the first day when all four of these conditions are no longer 
true (all above the level) after having been true. I have tried various 
attempts using exrem and flip and  highestsince and combinations 
thereof but I can't seem to get there. I am hoping this is a common 
issue and someone can steer my down the right path.

Thanks,
Tom

Sector_50DMA = Sector_ratio <= LastValue(Percentile
(Sector_ratio,Limit_period,10));

Industry_50DMA = Industry_ratio <= LastValue(Percentile

Industry_rsi = RSIa(FC,12) <= LastValue(Percentile(RSIa(FC, 
12),Limit_period,10));

stock_RSI = RSI(12) <= LastValue(Percentile(RSI(12),Limit_period,10));

BUY = Sector_50DMA AND Industry_50DMA AND Industry_rsi and stock_RSI

 


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.37/682 - Release Date: 2/12/2007 1:23 PM