Hello,
I want Amibroker to Buy if there has been:
- a consolidation (flatline/ small bars moving between a small price range) , and
- this is followed by a breakout bar ( ie a medium/ large bullish bar) that looks significant compared to the consolidation bars.
I have coded this. But I am struggling to get it to work. Is what I'm asking too restrictive?
Has anyone done this before..... preferably in beginner (array) language?
Code:
highval= Ref (HHV (H, 15), -1);
lowval = Ref (LLV (L, 15), -1);
percentchange = ((highval - lowval)/ lowval)*100;
Cond1 = percentchange < 2; // consolidation moves in a range of less than 2%
Cond2 = H> (1.05*L); // Big candle
Cond3 = C>O and C>L; // Green bar
Cond4 = C>highval; // Close of big bar is greater than highest high in consolidation period
Buy = Cond1 AND Cond2 AND Cond3 AND Cond4;
Sell = 0;
Applystop (stopTypeTrailing, stopModePercent,10,0,True,0);
Thanks in advance,
Regards
Tradezy
I want Amibroker to Buy if there has been:
- a consolidation (flatline/ small bars moving between a small price range) , and
- this is followed by a breakout bar ( ie a medium/ large bullish bar) that looks significant compared to the consolidation bars.
I have coded this. But I am struggling to get it to work. Is what I'm asking too restrictive?
Has anyone done this before..... preferably in beginner (array) language?
Code:
highval= Ref (HHV (H, 15), -1);
lowval = Ref (LLV (L, 15), -1);
percentchange = ((highval - lowval)/ lowval)*100;
Cond1 = percentchange < 2; // consolidation moves in a range of less than 2%
Cond2 = H> (1.05*L); // Big candle
Cond3 = C>O and C>L; // Green bar
Cond4 = C>highval; // Close of big bar is greater than highest high in consolidation period
Buy = Cond1 AND Cond2 AND Cond3 AND Cond4;
Sell = 0;
Applystop (stopTypeTrailing, stopModePercent,10,0,True,0);
Thanks in advance,
Regards
Tradezy