AFL writing guide for new user

mithoon

Active Member
#81
Hi DM,
I have been trying to get the distance between two pivots and have looked all over the net but have not found anything yet,what i am looking for is an AFL which will show me the distance between two pivots ie pivot and a mid point on the chart,or at least the distance from the pivot point to the mid point between R1 and the pivot point and the distance between pivot point to the mid point below ie the mid point from from the pivot and the S1 ,my AFL for Pivot+mid point is as follows;
_SECTION_BEGIN("ppint");
H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));
//O1=SelectedValue(TimeFrameGetPrice( "O", inDaily));

/*PIVOT Calculation*/

//p = ( H1+ L1 + O1 )/3;
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);
R4 = R2 +(H1-L1);
S4 = S2 -(H1-L1);


//Plot(R4,"R4",colorRed);
//Plot((r4+r3)/2, "Mid Value of R4 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r3,"R3",colorRed,styleNoTitle);
//Plot((r3+r2)/2, "Mid Value of R2 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r2,"R2",colorWhite,styleDashed,styleNoTitle);
//Plot((r1+r2)/2, "Mid Value of R1 & R2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (r1,"R1",colorWhite,styleDashed,styleNoTitle);
Plot((p+r1)/2, "Mid Value of R1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);

Plot (p,"Pivot",colorOrange,styleDashed,styleNoTitle);

Plot((p+s1)/2, "Mid Value of S1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s1,"S1",colorWhite,styleDashed,styleNoTitle);
Plot((s1+s2)/2, "Mid Value of S1 & S2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s2,"S2",colorWhite,styleDashed,styleNoTitle);
//Plot((s3+s2)/2, "Mid Value of S2 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (s3,"S3",colorGreen,styleNoTitle);
//Plot((s3+s4)/2, "Mid Value of S4 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot(S4,"S4",colorGreen);

Would request you to kindly help me with the same.
 
#82
Hi Debarghya
I am also a newbie and trying to learn the AFL but i am using amibroker 4.8 ....

Some AFLs do not work on my 4.8 Ami, they show such errors like

Syntax error, expecting ')" or ','

etc.

could you please consider to publish the required plugin link or please PM to me.

"There are some Plugin required to run this code. I will PM u the link required to run this." http://www.traderji.com/amibroker/60292-afl-writing-guide-new-user-2.html#post591374

Thank you.
 
#83
u can post here ";" "," missing afls. These are easy to solve. I will try to help you, if i get time. No need for plugin

Hi Debarghya
I am also a newbie and trying to learn the AFL but i am using amibroker 4.8 ....

Some AFLs do not work on my 4.8 Ami, they show such errors like

Syntax error, expecting ')" or ','

etc.

could you please consider to publish the required plugin link or please PM to me.

"There are some Plugin required to run this code. I will PM u the link required to run this." http://www.traderji.com/amibroker/60292-afl-writing-guide-new-user-2.html#post591374

Thank you.
 
#84
Hai DM

When we use "alertif" command for autoscan, we will get the results in alert window. For a buy signal, I need to get Blue Up Arrow and for a Sell signal, Red Down Arrow.

When I used the below commands, i got the result as up arrow for both buy and sell.

AlertIf( Buy, "", "Buy", 4 );
AlertIf( Sell, "", "Sell", 4);
 
#85
Use this code:

AlertIf( Buy, "", "Buy Signal Has been Generated", 1 );
AlertIf( Sell, "", "Sell Signal Has been Generated", 2 );


Hai DM

When we use "alertif" command for autoscan, we will get the results in alert window. For a buy signal, I need to get Blue Up Arrow and for a Sell signal, Red Down Arrow.

When I used the below commands, i got the result as up arrow for both buy and sell.

AlertIf( Buy, "", "Buy", 4 );
AlertIf( Sell, "", "Sell", 4);
 
#88
Hai DM

Can you put a line horizontal to Price, like below, when price move, this line also need to move, so we can get an idea, whether current price is equal to previous high or low.

-----------------------------------------------------841
 
#89
I am trying to get amibroker to plot a price chart using EOD data converted from metastock with "no gap" option so I get one smooth continuous priceline display...and this chart..I would like to plot EMAs and any other indicators based on the data
from this "no gap" dataset...is that possible?
 
#90
DM sir,

I want make AFL , buy generated when DISP moving average (30,15 ) croses EMA 15.. & SEll generated when ema15 crosses DISP moving average (30, 15)..

I have learn to make crossover of simple Moving average from this thread but i m not able to make DISP moving average crossover AFL..

I request u to help whenever u get free time..

regds

U are welcome. When ever I get time I try to help others.
 

Similar threads