Need afl to scan yesterdays low and high

hmsanil

Active Member
#11
HI Detwo,

I tried first itself,but could not do it

Here is my tried code

Daba = Param("Days Back", 1, 1, 10,1);
H0 = TimeFrameGetPrice("H", inDaily, 0);
L0 = TimeFrameGetPrice("L", inDaily, 0);
H1 = TimeFrameGetPrice("H", inDaily, -Daba);
L1 = TimeFrameGetPrice("L", inDaily, -Daba);



H2 = IIf((H1-C) < .001*C AND C < H1, C, 0);
L2 = IIf((C-L1) < .001*C AND C > L1 , C, 0);

H3 = IIf((H1-C) < .001*C AND C < H2, C, 0);
L3 = IIf((C-L1) < .001*C AND C > L2 , C, 0);


Filter = Status("lastbarinrange");

format = 1.2;

AddColumn(H0, "High of today", format, colorGreen, colorBlack, 95);
AddColumn(L0, "Low of today", format, colorRed, colorBlack, 95);
AddColumn(H1, "High of prev day", format, colorPaleGreen, colorBlack, 95);
AddColumn(L1, "Low of prev day", format, colorOrange, colorBlack, 95);
AddColumn(H2, "C near prev High", format, IIf(H2, colorPaleGreen, colorBlack), colorBlack, 95);
AddColumn(L2, "C near prev Low", format, IIf(L2, colorOrange, colorBlack), colorBlack, 95);
AddColumn(H3, "C near Today High", format, IIf(H3, colorPaleGreen, colorBlack), colorBlack, 95);
AddColumn(L2, "C near Today Low", format, IIf(L3, colorOrange, colorBlack), colorBlack, 95);


Thanks

Anil
 
#12
Code:
Daba = Param("Days Back", 1, 1, 10,1);
H0 = TimeFrameGetPrice("H", inDaily, 0);
L0 = TimeFrameGetPrice("L", inDaily, 0);
H1 = TimeFrameGetPrice("H", inDaily, -Daba);
L1 = TimeFrameGetPrice("L", inDaily, -Daba);

H2 = IIf((H1-C) < .001*C AND C < H1, C, 0);
L2 = IIf((C-L1) < .001*C AND C > L1 , C, 0);

H3 = IIf((H0-C) < .001*C AND C < H0, C, 0);
L3 = IIf((C-L0) < .001*C AND C > L0 , C, 0);

Filter = Status("lastbarinrange");

format = 1.2;

AddColumn(H0, "High of today", format, colorGreen, colorBlack, 95);
AddColumn(L0, "Low of today", format, colorRed, colorBlack, 95);
AddColumn(H1, "High of prev day", format, colorPaleGreen, colorBlack, 95);
AddColumn(L1, "Low of prev day", format, colorOrange, colorBlack, 95);
AddColumn(H2, "C near prev High", format, IIf(H2, colorPaleGreen, colorBlack), colorBlack, 95);
AddColumn(L2, "C near prev Low", format, IIf(L2, colorOrange, colorBlack), colorBlack, 95);
AddColumn(H3, "C near Today High", format, IIf(H3, colorGreen, colorBlack), colorBlack, 95);
AddColumn(L3, "C near Today Low", format, IIf(L3, colorRed, colorBlack), colorBlack, 95);
Compare the code with your one. Still I did not test the code so compare with what the charts are showing
 
#14
"final" version

Code:
Daba = Param("Days Back", 1, 1, 10,1);
H0 = TimeFrameGetPrice("H", inDaily, 0);
L0 = TimeFrameGetPrice("L", inDaily, 0);
H1 = TimeFrameGetPrice("H", inDaily, -Daba);
L1 = TimeFrameGetPrice("L", inDaily, -Daba);

H2 = IIf(H0/C < 1.001 AND C < H0, C, 0);
L2 = IIf(L0/C > 0.999 AND C > L0 , C, 0);

H3 = IIf(H1/C < 1.001 AND C < H1, C, 0);
L3 = IIf(L1/C > 0.999 AND C > L1 , C, 0);

Filter = Status("lastbarinrange");

format = 1.2;

AddColumn(H0, "High of today", format, colorGreen, colorBlack, 95);
AddColumn(L0, "Low of today", format, colorRed, colorBlack, 95);
AddColumn(H2, "C near Today High", format, IIf(H2, colorGreen, colorBlack), colorBlack, 95);
AddColumn(L2, "C near Today Low", format, IIf(L2, colorRed, colorBlack), colorBlack, 95);
AddColumn(H1, "High of prev day", format, colorPaleGreen, colorBlack, 95);
AddColumn(L1, "Low of prev day", format, colorOrange, colorBlack, 95);
AddColumn(H3, "C near prev High", format, IIf(H3, colorPaleGreen, colorBlack), colorBlack, 95);
AddColumn(L3, "C near prev Low", format, IIf(L3, colorOrange, colorBlack), colorBlack, 95);
 

aggy

Active Member
#15
hey detwo can you please make some modifications in your code as it shows the result alphabatically i wanna it shows the result by high low value. Any scrip whose values change come on TOP.
 

Similar threads