Hi guys! can anybody help me?
I want to write a module to explore stocks under cirtain conditions,
A) IF PRICE OF STOCK IS IN THE RANGE OF RS.50.00 TO 250.00
1) buy = sma 5 - sma 25 > 2.00, (i.E. DIFFERENCE IN SMA SHOULD BE GREATER THAN 2.00) and sma 5 is crossing above the sma 25,
2) SELL = sma 25 - sma 5 = 2.00, and 25 is crossing above the sma 5,
B) IF PRICE IS > 250 < 500 DIFFERENCE SMA SHOULD BE > 4.50,
C) IF PRICE IS > 500 < 800 DIFFERENCE SMA SHOULD BE > 7.00,
D) IF PRICE IS >800 < 1100 DIFFERENCE SMA SHOULD BE > 10.00,
Short = Cross(SMA (C,15), SMA (C,5));
Cover = Cross (SMA (C,5), SMA (C,15));
I have tried to write a module but i could not complete it and i think it is following only only one condition not the other one. pls. somebody correct this.
Cond1=Cross( SMA (C, 5 ) , SMA (C, 25 ));
Cond2= (SMA (C, 5 ) - SMA ( C,25 ) > 10 );
Cond3=Cross( SMA ( C, 25 ) , SMA ( C, 5 ));
Cond4=( SMA (C, 25 ) - SMA ( C, 5 ) > 10 );
D1= SMA(C,5) - SMA(C, 25);
D2= SMA(C,25) - SMA (C,5);
Buy = Cond1 + Cond2;
Sell= Cond3 + Cond4;
Short = Cross(SMA (C,15), SMA (C,5));
Cover = Cross (SMA (C,5), SMA (C,15));
Filter= (Close > 800.00 < 1100.00);
Filter=Buy;
Filter=Sell;
Filter =Short;
Filter=Cover;
AddColumn( Close, "Close", 1.2 );
AddColumn( D1,"Buy MAD", 1.4 );
AddColumn( D2,"Sell MAD", 1.4 );
AddColumn( Cond1+Cond2, "BUY", 0 );
AddColumn( Cond3+Cond4, "SELL", 0 );
AddColumn(Short,"coverBuy",1.2);
AddColumn(Cover,"coverSell",1.2);
suggetions are most wellcome!
Please, Please, Please, Please.......... help me out to complete the task.
I want to write a module to explore stocks under cirtain conditions,
A) IF PRICE OF STOCK IS IN THE RANGE OF RS.50.00 TO 250.00
1) buy = sma 5 - sma 25 > 2.00, (i.E. DIFFERENCE IN SMA SHOULD BE GREATER THAN 2.00) and sma 5 is crossing above the sma 25,
2) SELL = sma 25 - sma 5 = 2.00, and 25 is crossing above the sma 5,
B) IF PRICE IS > 250 < 500 DIFFERENCE SMA SHOULD BE > 4.50,
C) IF PRICE IS > 500 < 800 DIFFERENCE SMA SHOULD BE > 7.00,
D) IF PRICE IS >800 < 1100 DIFFERENCE SMA SHOULD BE > 10.00,
Short = Cross(SMA (C,15), SMA (C,5));
Cover = Cross (SMA (C,5), SMA (C,15));
I have tried to write a module but i could not complete it and i think it is following only only one condition not the other one. pls. somebody correct this.
Cond1=Cross( SMA (C, 5 ) , SMA (C, 25 ));
Cond2= (SMA (C, 5 ) - SMA ( C,25 ) > 10 );
Cond3=Cross( SMA ( C, 25 ) , SMA ( C, 5 ));
Cond4=( SMA (C, 25 ) - SMA ( C, 5 ) > 10 );
D1= SMA(C,5) - SMA(C, 25);
D2= SMA(C,25) - SMA (C,5);
Buy = Cond1 + Cond2;
Sell= Cond3 + Cond4;
Short = Cross(SMA (C,15), SMA (C,5));
Cover = Cross (SMA (C,5), SMA (C,15));
Filter= (Close > 800.00 < 1100.00);
Filter=Buy;
Filter=Sell;
Filter =Short;
Filter=Cover;
AddColumn( Close, "Close", 1.2 );
AddColumn( D1,"Buy MAD", 1.4 );
AddColumn( D2,"Sell MAD", 1.4 );
AddColumn( Cond1+Cond2, "BUY", 0 );
AddColumn( Cond3+Cond4, "SELL", 0 );
AddColumn(Short,"coverBuy",1.2);
AddColumn(Cover,"coverSell",1.2);
suggetions are most wellcome!
Please, Please, Please, Please.......... help me out to complete the task.