AFL writing guide for new user

ocil

Well-Known Member
Hi friends,

I need your help on below AFL . I need whenever on 7m price candle close above R2 blue line it will generate buy signal & below R1 yellow line it will generate sell signal. Can any one help me. i am not a tech...Thanks for you help.

_SECTION_BEGIN("Price");
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", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Nifty");

NewDay = Day()!= Ref(Day(), -1);
DH = HHV( H, NewDay);
DL = LLV(L, NewDay);
Plot(DH,"DAY HIGH",colorGrey40,styleDashed,0,0,0);
Plot(DL,"DAY LOW",colorGrey40,styleDashed,0,0,0);
R1=((DH-DL)*0.33)+DL;
R2=((DH-DL)*0.66)+DL;
Plot(R1,"BEARISH BELOW",colorYellow,styleDashed,0,0,0);
Plot(R2,"BULLISH ABOVE",colorBlue,styleDashed,0,0,0);
 

ethan hunt

Well-Known Member
I am very thankful to you for taking initiative to teach other...

it will be great if you please help in making afl forfolowing condition

candles shold be green if close > ema 21 and MACD >0

candles shold be red if close < ema 21 and MACD <0

candles shold be white if no condition satisfied


THANKING YOU IN ADVANCE
Hi,

On intrday data,


TimeFrameSet(inDaily);

u r ema crossover condition.

TimeFrameRestore();

plot(c,"",1,128);// This is bar chart on time frame u have selected

johnny
Hi,

Not able to make it.

Kindly help.
 

johnnypareek

Well-Known Member
Hi friends,

I need your help on below AFL . I need whenever on 7m price candle close above R2 blue line it will generate buy signal & below R1 yellow line it will generate sell signal. Can any one help me. i am not a tech...Thanks for you help.

_SECTION_BEGIN("Price");
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", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Nifty");

NewDay = Day()!= Ref(Day(), -1);
DH = HHV( H, NewDay);
DL = LLV(L, NewDay);
Plot(DH,"DAY HIGH",colorGrey40,styleDashed,0,0,0);
Plot(DL,"DAY LOW",colorGrey40,styleDashed,0,0,0);
R1=((DH-DL)*0.33)+DL;
R2=((DH-DL)*0.66)+DL;
Plot(R1,"BEARISH BELOW",colorYellow,styleDashed,0,0,0);
Plot(R2,"BULLISH ABOVE",colorBlue,styleDashed,0,0,0);
_SECTION_BEGIN("Price");

TimeFrameSet(7* in1Minute );
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() );
_SECTION_END();
_SECTION_BEGIN("Nifty");

NewDay = Day()!= Ref(Day(), -1);
DH = HHV( H, NewDay);
DL = LLV(L, NewDay);
Plot(DH,"DAY HIGH",colorGrey40,styleDashed,0,0,0);
Plot(DL,"DAY LOW",colorGrey40,styleDashed,0,0,0);
R1=((DH-DL)*0.33)+DL;
R2=((DH-DL)*0.66)+DL;
Plot(R1,"BEARISH BELOW",colorYellow,styleDashed,0,0,0);
Plot(R2,"BULLISH ABOVE",colorBlue,styleDashed,0,0,0);
TimeFrameRestore();
Buy=Cross(C,r2);Sell=Cross(r1,C);
SellPrice=ValueWhen(Sell,O,1);
BuyPrice=ValueWhen(Buy,O,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-45);

PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-25);
above is as u asked.

Can u plez write the sys inter...?

johnny
 

ethan hunt

Well-Known Member
Dear Johnny,

thanks.

but somehow while posting my previous messege a wrong messege was quoted.

My AFL requirement is as below:

Condition A (Eg: EMA 20 & EMA 100 crossover)
PREVIOUS DAY: Stocks meet Condition A in EOD charts.

Condition B (Eg: Break of Hi / Lo of previous day)
TODAY: Such short listed stocks meeting condition A to be scanned in Intraday Charts for break of previous day Hi / Lo (Condition B)

Is it possible to combine condition A & B in one AFL, so that the scanning is done TODAY in Intraday charts ?

Separate AFLs for Condition A & B can be made, but how to combine into one AFL as first condition is EOD & second is Intraday real time !
 
hey guys

i guess u all use amibroker
i wanted to get amibroker for better analysis in my TA

my question is do i have to buy amibroker online or is it available for free online ?
if i have to buy where is the best n trusted place to do so?

any information about this will to useful

also which is a good data feed for the amibroker

guys please help me out
thanx in advance
 
hey guys

i guess u all use amibroker
i wanted to get amibroker for better analysis in my TA

my question is do i have to buy amibroker online or is it available for free online ?
if i have to buy where is the best n trusted place to do so?

any information about this will to useful

also which is a good data feed for the amibroker

guys please help me out
thanx in advance
hello sayantan

please PM your email id .... i'll try to solve your problem...


Regards
AnAthiest:)
 
Hello friends,

I am very new to AFL writing and have no knowledge on language but trying it searching information on web. Stuck in few things and would be great if anyone can help solving it.

A) I am looking AFL to plot trendline on similar values on chart. For e.g.

Day1 Day2 Day3 Day4 Day5
113 121 119 121 126 (Close Price )

As above the value of Close price in Day2 & Day4 is same, require trendline at "121"

B) Also looking AFL for High value since the "BUY" trigger

please help
NO HELP IN THIS FORUM ?? sad
 

Similar threads