5 Days consecutive high price/volume

sahil79

Active Member
#1
Hi Hulk, Nagarjuna, Hitesh and other experts, can someone plz give me an afl to explore the stock, the conditions are as following :-
1. 5 days consecutive high price.
2. 5 days consecutive high Volume
3. Last two day's volume more thn 150,000.
4. Last 2 day's price increase 5%.
5. Stocks value more thn 200 RS.

thanx in advance
santosh
 
#2
try this...

Condition1 = H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3) AND Ref(H,-3)>Ref(H,-4);
Condition2 = V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2) AND Ref(V,-2)>Ref(V,-3) AND Ref(V,-3)>Ref(V,-4);
Condition3 = V>150000 AND (Ref(V,-1)>150000);
Condition4 = C>=(Ref(C,-1)*1.05) AND Ref(C,-1)>=(Ref(C,-2)*1.05);
Condition5 = C>200;
Buy = Condition1 AND Condition2 AND Condition3 AND Condition4 AND Condition5;
Filter = Condition1 AND Condition2 AND Condition3 AND Condition4 AND Condition5;
AddColumn(Close,"Buy ");

_SECTION_BEGIN("Santosh");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

PlotShapes(shapeUpArrow * Buy, colorGreen,0,L,-12);

_SECTION_END();
 
Last edited:

sahil79

Active Member
#3
Thanx manish for ur help, can u do a little tweak in it? Now my conditions are condition 1, condition 2 and condition 5. suppose, we have a list of stock A to Z but I wish to scan only few of them (C,I,K,M W and Y). And if possible, scan result should show consecutive price/volume as well?


Consecutive High
Ticker Date/Time D2Price Y'day Price Today's Price D2Volume Y'day Volume Volume Buy/Sell
Stock A 29/07/10 1110.10 1150.05 1210.10 684583.00 799047.00 899047.00 Buy
Stock B 29/07/10 1208.35 1333.20 1363.90 154874.00 354874.00 554874.00 Buy

Consecutive Low
Ticker Date/Time D2Price Y'day Price Today's Price D2Volume Y'day Volume Volume Buy/Sell
Stock C 29/07/10 800.10 776.05 750.10 684583.00 499047.00 385219.00 Sell
Stock D 29/07/10 550.35 525.20 500.90 454874.00 325577.00 151974.00 Sell

thanx in advance
santosh
 
Last edited:

sahil79

Active Member
#5
Hello Santosh...

u want consecutive high value or close value?

Regards,

Manish
Thanx manish for ur help. I did as following :-

Buy=C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND Ref(C,-3)>Ref(C,-4);
Buy=V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2) AND Ref(V,-2)>Ref(V,-3) AND Ref(V,-3)>Ref(V,-4);


AddColumn( Ref(V,-4), "D4" );
AddColumn( Ref(V,-3), "D3" );
AddColumn( Ref(V,-2), "D2" );
AddColumn( Ref(V,-1), "YESTERDAY " );
AddColumn( Volume, "Volume" );

AddColumn( Ref(C,-4), "D4" );
AddColumn( Ref(C,-3), "D3" );
AddColumn( Ref(C,-2), "D2" );
AddColumn( Ref(C,-1), "YESTERDAY " );
AddColumn( Close, "Close" );
Filter = Buy AND V > 100000 AND C > 200;

Plz solve above formula and I wish to put consecutive low (close) as well in it.
 
Last edited:
#6
Hello Santosh... try this one.

String = StrLeft(Name(),1);
Condition1 = String == "C" OR String == "I" OR String == "K" OR String == "M" OR String == "W" OR String == "Y";
Condition2 = C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND Ref(C,-3)>Ref(C,-4);
Condition3 = V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2) AND Ref(V,-2)>Ref(V,-3) AND Ref(V,-3)>Ref(V,-4);
Condition4 = C<Ref(C,-1) AND Ref(C,-1)<Ref(C,-2) AND Ref(C,-2)<Ref(C,-3) AND Ref(C,-3)<Ref(C,-4);
Condition5 = V<Ref(V,-1) AND Ref(V,-1)<Ref(V,-2) AND Ref(V,-2)<Ref(V,-3) AND Ref(V,-3)<Ref(V,-4);
Condition6 = C>200;
Buy = Condition1 AND Condition2 AND Condition3 AND Condition6;
Sell = Condition1 AND Condition4 AND Condition5 AND Condition6;

Filter = Buy OR Sell;

AddColumn(Ref(V,-4),"V(D-4)");
AddColumn(Ref(V,-3),"V(D-3)");
AddColumn(Ref(V,-2),"V(D-2)");
AddColumn(Ref(V,-1),"V(D-1)");
AddColumn(Volume,"Volume");

AddColumn(Close,"Close");
AddColumn(Ref(C,-1),"C(D-1)");
AddColumn(Ref(C,-2),"C(D-2)");
AddColumn(Ref(C,-3),"C(D-3)");
AddColumn(Ref(C,-4),"C(D-4)");

AddTextColumn(WriteIf((C>Ref(C,-1) AND V>Ref(V,-1)),"Buy","Sell"),"Buy/Sell");

_SECTION_BEGIN("Santosh");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

PlotShapes(shapeUpArrow * Buy, colorGreen,0,L,-12);

_SECTION_END();
 
#7
Dear Manish,

I have downloaded the trial version of amibroker, but don't know how to set it up for indian markets/scripts. Will appriciate if you can guide me in this respect.

Thanks in advance

Hello Santosh... try this one.

String = StrLeft(Name(),1);
Condition1 = String == "C" OR String == "I" OR String == "K" OR String == "M" OR String == "W" OR String == "Y";
Condition2 = C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND Ref(C,-3)>Ref(C,-4);
Condition3 = V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2) AND Ref(V,-2)>Ref(V,-3) AND Ref(V,-3)>Ref(V,-4);
Condition4 = C<Ref(C,-1) AND Ref(C,-1)<Ref(C,-2) AND Ref(C,-2)<Ref(C,-3) AND Ref(C,-3)<Ref(C,-4);
Condition5 = V<Ref(V,-1) AND Ref(V,-1)<Ref(V,-2) AND Ref(V,-2)<Ref(V,-3) AND Ref(V,-3)<Ref(V,-4);
Condition6 = C>200;
Buy = Condition1 AND Condition2 AND Condition3 AND Condition6;
Sell = Condition1 AND Condition4 AND Condition5 AND Condition6;

Filter = Buy OR Sell;

AddColumn(Ref(V,-4),"V(D-4)");
AddColumn(Ref(V,-3),"V(D-3)");
AddColumn(Ref(V,-2),"V(D-2)");
AddColumn(Ref(V,-1),"V(D-1)");
AddColumn(Volume,"Volume");

AddColumn(Close,"Close");
AddColumn(Ref(C,-1),"C(D-1)");
AddColumn(Ref(C,-2),"C(D-2)");
AddColumn(Ref(C,-3),"C(D-3)");
AddColumn(Ref(C,-4),"C(D-4)");

AddTextColumn(WriteIf((C>Ref(C,-1) AND V>Ref(V,-1)),"Buy","Sell"),"Buy/Sell");

_SECTION_BEGIN("Santosh");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

PlotShapes(shapeUpArrow * Buy, colorGreen,0,L,-12);

_SECTION_END();
 

singhboy

Active Member
#8
Dont buy after 5 days of consecutive high, after 4-5 days consecutive highs, stocks pause n start trading in very narrow range, they trade in very narrow range for 4-10 trading days b4 starting their upmove once again. During these 4-10 days period they may even correct 25% of Gain in last 5 consecutive days. Besides, during this narrow range period they buy sell signals u will get would fails mostly. So better put the condition of 2 consecutive days of high while let the rest of condition remain same