hi there! I've been trying to make this code now for a few days and it constantly returns results, but they are not correct.
Can anyone please help me?
This is what I have:
Cond1=Cross( MACD ( 12 , 26 ) , Signal ( 12, 26, 9 ) );
Cond2=Cross( StochK ( 15 , 3 ) , StochD ( 15, 3, 3 ) );
Cond3=Close > HHV( High, 100 );
Cond4=Cross( Signal ( 12, 26, 9 ) , MACD ( 12, 25 ));
Cond5=Cross( StochD ( 15, 3, 3 ) , StochK ( 15 , 3 ) );
Buy=Cond1+Cond2+Cond3;
Sell=Cond3+Cond4;
Filter=Buy;
AddColumn( Close, "Close", 1.2 );
AddColumn( MACD ( 12, 26 ) , "MACD", 1.2 );
AddColumn( Signal ( 12, 26, 9 ) , "Signal", 1.2 );
AddColumn( StochK ( 15 , 3 ) , "K%", 1.3 );
AddColumn( StochD ( 15 , 3 , 3 ) , "D%", 1.3 );
Syntax seems to be ok, as I check it before analysis.
What I would like is to filter only buy signals where:
-the MACD has crossed its signal line
-the StochK is higher than the StochD
-the closing price is at a 3-month high
Thanks a lot!
Can anyone please help me?
This is what I have:
Cond1=Cross( MACD ( 12 , 26 ) , Signal ( 12, 26, 9 ) );
Cond2=Cross( StochK ( 15 , 3 ) , StochD ( 15, 3, 3 ) );
Cond3=Close > HHV( High, 100 );
Cond4=Cross( Signal ( 12, 26, 9 ) , MACD ( 12, 25 ));
Cond5=Cross( StochD ( 15, 3, 3 ) , StochK ( 15 , 3 ) );
Buy=Cond1+Cond2+Cond3;
Sell=Cond3+Cond4;
Filter=Buy;
AddColumn( Close, "Close", 1.2 );
AddColumn( MACD ( 12, 26 ) , "MACD", 1.2 );
AddColumn( Signal ( 12, 26, 9 ) , "Signal", 1.2 );
AddColumn( StochK ( 15 , 3 ) , "K%", 1.3 );
AddColumn( StochD ( 15 , 3 , 3 ) , "D%", 1.3 );
Syntax seems to be ok, as I check it before analysis.
What I would like is to filter only buy signals where:
-the MACD has crossed its signal line
-the StochK is higher than the StochD
-the closing price is at a 3-month high
Thanks a lot!