Help: Need AFL for SavantJi's System

docvijay4u

Well-Known Member
#1
Hi, I am following SavantJi's Thread since couple of wks. To follow along I need following mentioned indicators to scan stocks for generating buy/sell signals. I am not much familiar with techie stuff, so please I need help of Experts in the forum.

Below is requirement in SavantJi's own word:

There Are Experts In The Forum Who Can Help With AFL, Just Request Them For AFL With Following Parameters To Scan For:

a) 2 SMAs (Different Colours)
1) SMA 5
2) SMA 6

b) Crossover Of Either SMAs (6 Over 5 Bearish & 5 Over 6 Bullish)

c) Request If They Can Do Something Whereby You Can Find The Stocks Where The SMAs Have Almost Converged To A Point

d) BB (Close 9, Std Deviation 2) With SMA Not EMA

e) Configurable For Either Bars Or Candle Whichever You Prefer


Thanks:)
 

rajendrani

Well-Known Member
#2
Hi, I am following SavantJi's Thread since couple of wks. To follow along I need following mentioned indicators to scan stocks for generating buy/sell signals. I am not much familiar with techie stuff, so please I need help of Experts in the forum.

Below is requirement in SavantJi's own word:

There Are Experts In The Forum Who Can Help With AFL, Just Request Them For AFL With Following Parameters To Scan For:

a) 2 SMAs (Different Colours)
1) SMA 5
2) SMA 6

b) Crossover Of Either SMAs (6 Over 5 Bearish & 5 Over 6 Bullish)

c) Request If They Can Do Something Whereby You Can Find The Stocks Where The SMAs Have Almost Converged To A Point

d) BB (Close 9, Std Deviation 2) With SMA Not EMA

e) Configurable For Either Bars Or Candle Whichever You Prefer


Thanks:)
We dont need expert for this, a little knowledge is ok, and play around with the software to know more


drag and drop and change the value accordingly and enjoy

Thanks and regards,
rajendrani
 

pkamalesh

Well-Known Member
#3
Hi, I am following SavantJi's Thread since couple of wks. To follow along I need following mentioned indicators to scan stocks for generating buy/sell signals. I am not much familiar with techie stuff, so please I need help of Experts in the forum.

Below is requirement in SavantJi's own word:

There Are Experts In The Forum Who Can Help With AFL, Just Request Them For AFL With Following Parameters To Scan For:

a) 2 SMAs (Different Colours)
1) SMA 5
2) SMA 6

b) Crossover Of Either SMAs (6 Over 5 Bearish & 5 Over 6 Bullish)

c) Request If They Can Do Something Whereby You Can Find The Stocks Where The SMAs Have Almost Converged To A Point

d) BB (Close 9, Std Deviation 2) With SMA Not EMA

e) Configurable For Either Bars Or Candle Whichever You Prefer


Thanks:)
Doc...U just need to Drag the indicators, then right click on the chart and select the values/colours..Its as simple as that..
 

docvijay4u

Well-Known Member
#4
Hello Rajendrani, Kamlesh. Thanks a lot for quick reply. I was playing around Ami, so took little time to reply.

Basically I need formula or say custom indicator to build .afl. So that I can apply it to individual scrip with a way You mentioned. And also will help to Automatic Analysis of the all EOD data to generate Buy / Sell signal.

Here DjSinha Helped with BB. DjSinha Will you please explain a bit what below code talks so that We can move up with main part SMA.

S.N. Oh forget to mention Rajendrani screenshot was Really helpful, thanks for taking effort n making time.:)

Thanks a Lot Friends.

Hi Doc,
You may need this code in AFL. This is in accordance with what Savant has said. It's for use with the automatic analyser of AMI to search for stocks which has started to reverse their trend after piercing bands on either sides. I've kept a filter of Avg Trading volumes over past 5 days being greater than 2.5L to filter out illiquid stocks. If you want to remove the filter, just remove the bold portions of the code below.


AFL code:
--------------------------------------------------------------------------
mean = Param("Mean",9,0,100,1);
std_devn = Param("Standard Deviation", 2,0,5,1);
Avg_vol = (Ref(Volume,-4)+ Ref(Volume,-3)+ Ref(Volume,-2)+ Ref(Volume,-1)+ Volume)/5;
Buy = Ref(Low,-1)<Ref(BBandBot(Close,mean,std_devn),-1) AND Low>BBandBot(Close,mean,std_devn) AND Avg_vol >250000 AND Close > Open;
Sell = Ref(High,-1)>Ref(BBandTop(Close,mean,std_devn),-1) AND High>BBandTop(Close,mean,std_devn) AND Avg_vol >250000 AND Close < Open;
--------------------------------------------------------------------------
Thanks and regards
djsinha
 
Last edited:

djsinha

Active Member
#5
Hi Doc
See the criteria for long here is:
1. Yesterday's low penetrated below the lower BB.
2. Today's low is above the lower BB.

1 + 2 signifies that after piercing through the lower BB, price has started to go up.

Simmilarly the criteria for short is:
1. Yesterday's high above yesterdays' top BB.
2. Today's high below today's top BB.

1+2 signifies that after piercing through the higher BB, price has started to retrace.

I'm attaching a picture with the BB. Signals are not plotted. I've pointed out 1 set of buy-sell signals.
Hope you can make out.
Regards
djsinha



Hello Rajendrani, Kamlesh. Thanks a lot for quick reply. I was playing around Ami, so took little time to reply.

Basically I need formula or say custom indicator to build .afl. So that I can apply it to individual scrip with a way You mentioned. And also will help to Automatic Analysis of the all EOD data to generate Buy / Sell signal.

Here DjSinha Helped with BB. DjSinha Will you please explain a bit what below code talks so that We can move up with main part SMA.

S.N. Oh forget to mention Rajendrani screenshot was Really helpful, thanks for taking effort n making time.:)

Thanks a Lot Friends.
 

Attachments

docvijay4u

Well-Known Member
#6
Hello Dj, Thanks for explaining BB with screenshot taking note of it in Ami. Today I was playing around formula for SavantJi's gem, here what I came up with (BB not working though when I removed Buy n Sell from Your formula):

============================
_SECTION_BEGIN("Price and EMA");

Plot(MA(C,5),"MA C 5", colorRed,styleLine);
Plot(MA(C,6),"MA C 6", colorBlack,styleLine);
Buy = Cross(MA(C, 5), MA(C, 6));
Sell= Cross(MA(C, 6), MA(C, 5));

_SECTION_END();
=============================

Basically I searched for similiar thing and just twiked values. I have absolutely no idea how to write it, so accuracy is questionable. When You will get time then Please give finishing touch to formula. One small request Please keep it as SavantJi mentioned. Why? Because later it would be difficult for me to edit. Many Many Thanks.:)

Hi Doc
See the criteria for long here is:
1. Yesterday's low penetrated below the lower BB.
2. Today's low is above the lower BB.

1 + 2 signifies that after piercing through the lower BB, price has started to go up.

Simmilarly the criteria for short is:
1. Yesterday's high above yesterdays' top BB.
2. Today's high below today's top BB.

1+2 signifies that after piercing through the higher BB, price has started to retrace.

I'm attaching a picture with the BB. Signals are not plotted. I've pointed out 1 set of buy-sell signals.
Hope you can make out.
Regards
djsinha
 

SavantGarde

Well-Known Member
#7
Hi Guys,

Didn't Know Doc Had Posted The Request Here....For AFL, Therefore Only Got To Know About It From My Regular Thread.

Firstly & Most Importantly My Sincere Thanks To Everybody...DJSinha, Rajendrani, Prasad, Kamalesh & To Doc For Posting The Request.

Now Coming To The Brasstacks.....

a) BB Is NOT A Buy Or Sell Trigger When Pierced On Either Side

b) It Is An Envelope Around The Price Action Indicating The Range

c) For Investors It Is An Alert When Pierced On The Upper BB To Probably Book Profit In That Particular Scrip...Or Atleast To Start Exiting & That It Will Come Down.

d) Heart Of The BUY & SELL Is The Crossover Of The SMAs Which Sustains For Some Period To Come....Till Opposing Crossover Has Taken Place.

e) Therefore, We Need An Exploratory System That Will Scan Primarily For SMA Crossover Or Better Still, If Something Can Be Added To AFL Whereby We Can Get A List Of Stocks Where The SMAs Have Converged Or Are About To Converge Noticeably, For An Early Entry....

f) Crossover Is Confirmatory Point Where Even Most Risk Averse Traders & Investors Can Take Up Position....For Sustained Move....That Also Provides A Very Good Early Entry Into The Scrip.

Once Again Sincere Thanks, May God Bless You All With Health, Wealth & Your Wishes


Happy & Safer Tradinng

SavantGarde
 

djsinha

Active Member
#8
Hi Doc
Good work by you. The code below on SMA is perfectly fine. Thank you for I don't have to write it:D.
The code on BB which I wrote was for use with automatic analyzer and not for plotting BB. As such you can't use it for plotting BB. If you want to plot BB or for that matter even SMA, just use the method which Rajendrani outlined by attaching the screenshot.
Regards
djsinha


Hello Dj, Thanks for explaining BB with screenshot taking note of it in Ami. Today I was playing around formula for SavantJi's gem, here what I came up with (BB not working though when I removed Buy n Sell from Your formula):

============================
_SECTION_BEGIN("Price and EMA");

Plot(MA(C,5),"MA C 5", colorRed,styleLine);
Plot(MA(C,6),"MA C 6", colorBlack,styleLine);
Buy = Cross(MA(C, 5), MA(C, 6));
Sell= Cross(MA(C, 6), MA(C, 5));

_SECTION_END();
=============================

Basically I searched for similiar thing and just twiked values. I have absolutely no idea how to write it, so accuracy is questionable. When You will get time then Please give finishing touch to formula. One small request Please keep it as SavantJi mentioned. Why? Because later it would be difficult for me to edit. Many Many Thanks.:)
 
Last edited:

docvijay4u

Well-Known Member
#9
Wow that means we are pretty close. If Rajendrani is here He can help us to come out of darkeness.

Dear Rajendrani, if You are reading this Please help us by providing Your BB formula for Ploting BB (Bollinger Band) (9, 2) & Select SMA If The Option Is Available. Thanks.

And Thanks for giving confirmation Dj and Captain for clerificaton on Buy n Sell signal. I am sure You would be following this until it finish.

Thanks

Hi Doc
Good work by you. The code below on SMA is perfectly fine. Thank you for I don't have to write it:D.
The code on BB which I wrote was for use with automatic analyzer and not for plotting BB. As such you can use it for plotting BB. If you want to plot BB or for that matter even SMA, just use the method which Rajendrani outlined by attaching the screenshot.
Regards
djsinha
 
Last edited:

SavantGarde

Well-Known Member
#10
Hi Doc,

Ok, If You Have Charting Software Such AMIBROKER, One Can Open A Daily or Intraday Chart & Choose The SMAs & BBs & Can See The Chart Like The One Posted....By Rajendrani.

You Can Do That With Individual Scrips & See It.

What We Are Looking Out For Is That Bhavcopy From NSE Which Will Include All The Traded Scrips Which Are Extracted From The Bhavcopy & Converted In AMI or MS, & Then When You Use A Particular .afl Depending On Parameters Programmed In The .afl It Will Go Through All The NSE Scrips & Give You A List or Report Which Match The Criterias Of That Particular .afl Programme.

For Instance The One Programmed By DJSinha BB.afl When That Is Used It Will Give You A List Of Scrips Meeting Those Parameters Programmed In It, Similarly We Need One For SMAs So That One Doesn't Have To Open The Chart Of Each Every Scrip To See What The SMAs & BB Are Doing.


Let's Say You Had 1000 Balls Of Different Colours & Wanted To Know How Many Of A Particular Colour Is There....Once The .afl For Colour Query & Quantity Is Activated Or Run It Will Generate A Report Telling X Number Of Balls Of Colour B Is There.

Opening Individual Charts Of Scrips Seeing Them With Parameters That You Want Is Similar To Sorting & Going Through Each Ball Manually.


In Simple Words .afl Is Query That A Software Understands


Got It......Hmmm....Sorry To Pinprick Your Short Lived Elation....:)


Happy & Safer Trading

SavantGarde

Wow that means we are pretty close. If Rajendrani is here He can help us to come out of darkeness.

Dear Rajendrani, if You are reading this Please help us by providing Your BB formula for Ploting BB (Bollinger Band) (9, 2) & Select SMA If The Option Is Available. Thanks.

And Thanks for giving confirmation Dj and Captain for clerificaton on Buy n Sell signal. I am sure You would be following this until it finish.

Thanks
 
Last edited:

Similar threads