# Composite Scanner

Dear Members,

I tried the following code but I don't understanding the following logic. Could anyone please give me guidance and suggestions regarding the same. Source :- https://stockbee.blogspot.in/2014/08/how-i-get-market-monitor-numbers.html

Stock up 50% or more in a month ( Telechart Code)
C20 >= 5 AND (AVGC20 * AVGV20) >= 250000 AND 100 * (C ­ C20) / C20 >= 50

what is meant by AVGC20? in the above code and how to write the above line in AFL Language.

``````_SECTION_BEGIN("Unnamed 22");

du= ((C-Ref(C,-1))/Ref(C,-1))>=(0.04)  AND V>=1000 AND V>Ref(V,-1) ;
dd= ((C-Ref(C,-1))/Ref(C,-1))<=(-0.04) AND V>1000 AND V>Ref(V,-1);

qu= ((C-Ref(C,-66))/Ref(C,-66))>0.25 ;
qd= ((C-Ref(C,-66))/Ref(C,-66))<-0.25 ;

mu= ((C-Ref(C,-22))/Ref(C,-22))>0.25 ;
md= ((C-Ref(C,-22))/Ref(C,-22))<-0.25 ;

ddu= ((C-Ref(C,-34))/Ref(C,-34))>0.13 ;
ddd= ((C-Ref(C,-34))/Ref(C,-34))<-0.13 ;

Buy = 0; // do not generate signals

s=Foreign("~4up","H");
s_col=IIf(s>100,colorBrightGreen,IIf(s>=50,colorPink,colorRed));
g=Foreign("~4dn","L");
g_col=IIf(g<=50,colorBrightGreen,IIf(g<=100,colorPink,IIf(g>200,colorRed,IIf(g>=900,colorOrange,colorRed))));
ratio=(MA(s,10)*10)/(MA(g,10)*10);

t=Foreign("~25qup","C");
t_col=IIf(t>=300,colorBrightGreen,IIf(t>=200,colorPink,colorRed));
u=Foreign("~25qdn","OI");
u_col=IIf(u>=200,colorRed,IIf(u>=200,colorPink,colorBrightGreen));

q=Foreign("~25mup","C");
q_col=IIf(t>=500,colorBrightGreen,IIf(t>=200,colorPink,colorRed));
z=Foreign("~25mdn","OI");
z_col=IIf(u>=500,colorRed,IIf(u>=200,colorPink,colorBrightGreen));

ds=Foreign("~13dup","C");
ds_col=IIf(ds>100,colorBrightGreen,IIf(ds>=10,colorPink,colorRed));
dg=Foreign("~13ddn","OI");
dg_col=IIf(dg<=50,colorBrightGreen,IIf(dg<=100,colorPink,IIf(dg>200,colorRed,IIf(dg>=900,colorOrange,colorRed))));

Filter=1;

_SECTION_END();
``````

Thank you

@amisur I can help with your question

There are different ways you could code this in afl (this uses your assumption that there are 20 trading days in a month which is not always the case),

``````UpFifty = ( ( C - Ref( C, -20 ) ) / Ref( C, -20 ) ) > 0.5 ;

// or use the rate-of-change indicator
Up50 = ROC(C, 20) > 50;
``````

The rest is Telechart code so you should people ask on a Telechart forum or ask the blogger or his paid subscribers at stockbee that gave you the idea. It is reasonable to guess that they are probably looking at some type of liquidity filter that incorporates the average volume multiplied by the average price.

But below you have included an elaborate Scan code so I am guessing that since you could not figure out the first basic question that you copied that and did not write the code yourself. Shouldn't you ask the author of that code what it is intended to do and how to use it. And perhaps give him credit for writing it?

I don't intend to sound mean or rude, but it is considered a common courtesy to credit the author if you did not have a significant role in writing the code or creating an indicator etc.

1 Like