AFL Request : Help Needed

singhboy

Active Member
#12
Hi Singhboy,

Here is the AFL you wanted:


H4 = HHV(H, 5) == H;

Filter = H4;

SetOption("NoDefaultColumns", True);

AddTextColumn(Name(), "Symbol");
AddColumn(DateTime(), "Date", formatDateTime);
AddColumn(C, "CMP", 1.2);


Run it in Automatic Analysis and Explore.

-Anant

Hi, ur afl doesnt work dude
 

asnavale

Well-Known Member
#13
Hi, ur afl doesnt work dude
Hi Dude,

It appears you do not know how to use the AFL. Just see the image below which lists all those stocks which satisfy the coindition of reaching a price higher than last four days' highest price.

There are a total of 223 stocks from NSE in this list.

The data is for 30-11-09.






-Anant
 

singhboy

Active Member
#14
yes it works fine, sory i changed afl to this
H4 = HHV(H, 5) == H;

Filter = H4;

SetOption("NoDefaultColumns", True);

AddTextColumn(Name(), "Symbol");
AddColumn(DateTime(), "Date", formatDateTime);
AddColumn(C, "CMP", 1.2);

Filter=(Volume>100000) AND (Close>100);
i wanted to filter stocks, i checked modified afls in formula editor, no error, so i used, but it doesnt works if i put volume n price filter conditions. Now can u pls improve it to filter voulume and price, Thnx alot
 

asnavale

Well-Known Member
#15
yes it works fine, sory i changed afl to this
H4 = HHV(H, 5) == H;

Filter = H4;

SetOption("NoDefaultColumns", True);

AddTextColumn(Name(), "Symbol");
AddColumn(DateTime(), "Date", formatDateTime);
AddColumn(C, "CMP", 1.2);

Filter=(Volume>100000) AND (Close>100);
i wanted to filter stocks, i checked modified afls in formula editor, no error, so i used, but it doesnt works if i put volume n price filter conditions. Now can u pls improve it to filter voulume and price, Thnx alot
Hi Singh,

replace the Filter = H4 with the following:

Filter = H4 AND V > 100000 AND C > 100;

-Anant
 

asnavale

Well-Known Member
#17
dear anant can u post .afl for the same which i can directly put in ab folder and use it....
You can block and copy the AFL code from my post itself, paste it in Note pad or better in AFL editor and save it with a suitable name.

-Anant
 
#18
Dear Ananth

I am new to amibroker .

If i want to check for conditions to be satisfied in two different time frames how is AFL written and how is the scan / exploration done ?

For instance, I require AFL for checking uptrend in 30 min timeframe as defined by rising 20 period sma and ADX between 20 to 25 and then check for a pull back in 5 min time frame as defined by Stoch (8,3,4) in 5 min time frame being less than 20 .

Could you help out with this ?
 

asnavale

Well-Known Member
#19
Dear Ananth

I am new to amibroker .

If i want to check for conditions to be satisfied in two different time frames how is AFL written and how is the scan / exploration done ?

For instance, I require AFL for checking uptrend in 30 min timeframe as defined by rising 20 period sma and ADX between 20 to 25 and then check for a pull back in 5 min time frame as defined by Stoch (8,3,4) in 5 min time frame being less than 20 .

Could you help out with this ?
You can use the TimeFrameSet and TimeFrameRestore functions. If you are using 5-min chart as default, you can do the indicator calculations in 30-min time frame as follows:

Code:
TimeframeSet(2*in15minutes);             // Set to 30 mins TF
SMA20 = MA(C, 20);                       // Calculate 20-period SMA of Close (in 30-min TF)
A = ADX(whatever period you want);

TimeFrameRestore();                     // Back to original TimeFrame of 5 min

S = {Stoch as per your parameters}      // This Stoch calculation will be in 5-min TF

{Do further calculations/comparisons etc. here}

{Plot or Exploration Code here}
-Anant
 
#20
Dear Ananth

When carrying out scan / exploration , how do you set the default time frame ?

I mean if i want to explore in 5 min time frame but with certain conditions satisfied in 30 min time frame as defined in the AFL , how do i set the default time frame of exploration as 5 min.??

Thanks and regards
gsri
 

Similar threads