Amibroker - AFL Examples

Hello Kuriakose

So you are from cochin. here is one of the missing.

SL = ( HHV( H, 22 ) + LLV( L, 22) )/2;
TL = ( HHV( H, 7) + LLV( L, 7 ) )/2;
DL = Ref( C, 22 );
Span1 = Ref( ( SL + TL )/2, -22 );
Span2 = Ref( (HHV( H, 44) + LLV(L, 44))/2, -22);
High=H;
Close=C;
Low=L;
TL=TL;
SL=SL;
DL=DL;
Span1=Span1;
Span2=Span2;
TLH=(TL+H)/2;
TLC=(TL+C)/2;
SLH=(SL+H)/2;
SLC=(SL+C)/2;
Span1=Span1;
Span2=Span2;

MaxGraph = 6;

Plot(SL,"SL",colorBlue,styleThick); // standard, base, or kijun-sen line
Plot(TL,"TL",colorRed,styleThick); // turning, conversion, or tenkan-sen line
Plot(DL,"DL",colorBlack,styleLine); // delayed, lagging, or chikou span
Plot(Close,"Close",colorYellow,styleLine,styleThick); // price close


Buy= Cross(C , TL ) ;
Sell=Cross(TL , C);
IIf( (Buy),PlotShapes(shapeUpArrow*Buy,colorBlue),0);
IIf( (Sell),PlotShapes(shapeDownArrow*Sell,colorRed),0);

Title = "{{NAME}} - {{INTERVAL}} {{DATE}} - Ichimokku -11: {{VALUES}}";
 
Hello Sanjay,


So since you are willing to give it a try and already has made some attempts i will give you a good AFL. It is called ichimokku. It is available in the library. But i have made certain modifications. The japanese are experts in trading and have better systems than western ones.

So open up your Amibroker , put this AFL on daily data, or weekly and study carefully what lines are doing under different market conditions and various scrips. it will give you lot of good profitable trades. But you need to find A WAY to avoid some false signals. Easisest method is to take the signal risk with proper money management and position size. ie get out with your commission loss or stoploss figure if trade goes against you or use it in combination with some other indicator. Another method is not to take long positions when price under MA(C,15). Vice versa for shorts. Keep a watch on the slope of MA(C,15) also to remove false signals.

One good feature of this AFL code is the lines does not vacillate too much . Only when there is a strong reversal of trend it crosses. When the trend is strong the lines are in smooth movement.

Another advantage is you can set your price targets and stoplosses using the red and blue lines. The DL line(black) is not necessary. I mask it using the // before plot statements. if necessary google and find more about ichimokku.


thank you saji for introducing me to the wondreful world of ichimoku.
view of a mountain man! it really is.
i goooogled it and the information i received was contradicting most of the trading method you described.
in your afl you have masked the DL line, in fact most of the information sources describe DL line as the final arbiter in making a trading decision.
also the price/TL newer considered as trading signal.
and you haven't given importance to clouds.
please make a comment
[
 
i want to draw some support or resistance levels on the price chart .but when i try to plot it plots the historical support and resistance levels.i only want the last support and res level only to be plotted ie the plots on the price graph should be against a single(last ) value of the resistance and suppport .ie the resistance and the support plots should be parallel to x axis.how do i proceed
Plot(Resistance1,"R1",colorRed);
right now i am using this plot function but it gives me the plot for all the support and resistance levels the stock has undergone.i only want to plot the latest support and resistance levels. iam using the formula

Pivot = ( Ref(High,0) + Ref(Close,0) + Ref(Low,0) )/3;
Resistance3 = Ref(High,0)+ 2 * (Pivot - Ref(Low,0));
Resistance1 = 2 * Pivot - Ref(Low,0);
Support1 = 2 * Pivot - Ref(High,0);
Resistance2 = Pivot + (Resistance1 - Support1);
Support2 = Pivot - (Resistance1 - Support1);
Support3 = Ref(Low,0)- 2 * (Ref(High,0) - Pivot);
Plot(Resistance1,"R1",colorRed);
Plot(Resistance2,"R2",colorRed);
Plot(Resistance3,"R3",colorRed);
Plot(Support1,"S1",colorOrange);
Plot(Support2,"S2",colorOrange);
Plot(Support3,"S3",colorOrange);

i found the resistance and support level logics from another thread in this forum.plz help me out
 

sholay

Active Member
Hi Saji

I am new to ami broker. I read this thread fully. It was interesting to read about Ichi afl. The old attached files are missing in this thread. so please repost the final afl so that I can understand the same and alos post any reading material on that.

Thanks
 
Dear Saji,

Have joined traderji recently. have read ur posts on Teach a man to fish
and am trying to understand it better. Thanks a lot for your efforts for newbies like me.

Meanwhile i need a help in coding the following condn. I tried it many times but am getting some errors. kindly please help me with this if u find time.

rsi<50 and macd>0 and 4sma>17sma>34ema>50sma to go long

rsi<40 and macd<0 and 4sma<17sma<34ema<50sma to go short

i can do only 2 condns at a time.

so please guide me in this.

ramash75
 
sir,

can anyone help me with a AFL to scan the stocks for the following conditions:

1. Price rises continuously for 3 days with increase in volume in each day .
2. Price decreases continuously for 3 days with increase in volume in each day.


Thanking you in advance
 
Hello,

Here is another method i have in my library. It is known as 4 MACD System. It can be used by day and swing traders. AFL code is also included. All these AFLs are only to enable new traders to trade stocks using different methods and systems and ulitimately find a method or system that will suit their trading personality and generate profits. Please note none of these methods or AFLs are created by me. I had collected it from various sources.

Regards

Saji
Where is the AFL? Thanks!
 

Similar threads