hi all,
I'm new to this community and also to AFL, so please bear with me if I ask any stupid questions or simple things that you all take for granted.
I'm trying to start out with a few simple codes. I have made the following:
Buy=Cross(MACD(),Signal());
Buy=EMA( Close, 20 ) > EMA( Close, 50 );
Buy=StochK( 14, 3 ) > StochD( 14, 3, 3 );
Sell=Cross(Signal(), MACD());
Sell=EMA( Close, 20 ) < EMA(Close, 50 );
Sell=StochK(14, 3 ) < StochD(14, 3, 3 );
Filter=Buy OR Sell;
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
AddColumn( MACD(), "MACD", 1.4 );
AddColumn( Signal(), "Signal", 1.4 );
AddColumn( StochK(), "StochK", 1.4 );
AddColumn( StochD(), "StochD", 1.4 );
This reflects the significance I attach to the EMA and the STS. However, when I Filter the results, a ticker gets inserted by Amibroker when it fulfills ONE of above buy/sell conditions. This is not what I want. I would like Amibroker to only filter the stocks for me that fulfill ALL of above Buy or sell conditions and only then show this ticker on the report screen.
How do I incorporate this into the code??
Thanks very very much for your assistance.
I'm new to this community and also to AFL, so please bear with me if I ask any stupid questions or simple things that you all take for granted.
I'm trying to start out with a few simple codes. I have made the following:
Buy=Cross(MACD(),Signal());
Buy=EMA( Close, 20 ) > EMA( Close, 50 );
Buy=StochK( 14, 3 ) > StochD( 14, 3, 3 );
Sell=Cross(Signal(), MACD());
Sell=EMA( Close, 20 ) < EMA(Close, 50 );
Sell=StochK(14, 3 ) < StochD(14, 3, 3 );
Filter=Buy OR Sell;
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
AddColumn( MACD(), "MACD", 1.4 );
AddColumn( Signal(), "Signal", 1.4 );
AddColumn( StochK(), "StochK", 1.4 );
AddColumn( StochD(), "StochD", 1.4 );
This reflects the significance I attach to the EMA and the STS. However, when I Filter the results, a ticker gets inserted by Amibroker when it fulfills ONE of above buy/sell conditions. This is not what I want. I would like Amibroker to only filter the stocks for me that fulfill ALL of above Buy or sell conditions and only then show this ticker on the report screen.
How do I incorporate this into the code??
Thanks very very much for your assistance.