please convert into afl
Thanx niranjan for helping others........its great work
I am giving below 2 my meta4 indicators.can you please convert it into afl
first one:-
//+------------------------------------------------------------------+
//| Gann HiLow Alert.mq4 |
//| mastermindg |
//|
[email protected] |
//| Props to Kalenzo for the code |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link "
[email protected]"
//----
#property indicator_buffers 1
#property indicator_color1 Gold
extern int Lookback = 10;
extern bool prepalert = True;
double ssl[],Hld,Hlv;
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,ssl);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
//Comment("Open of Previous Bar: ",Open[1]," Close of Previous Bar: ",Close[1]," Current Price: ",Bid);
for(int i=Bars-Lookback;i>=0;i--)
{
if(Close
>iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_HIGH,i+1 ))
Hld=1;
else
{
if(Close<iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_LOW,i+1) )
Hld=-1;
else
Hld=0;
}
if(Hld!=0)
Hlv=Hld;
if(Hlv==-1)
ssl=iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_HIGH,i+1 );
else
ssl=iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_LOW,i+1) ;
}
if(prepalert!=false)
{
if (Volume[0]==1) // On first tick of current bar only
{
if((Ask>ssl[0]) && (ssl[1]>=Open[1]) && (ssl[0]<=Close[0]))
{
string pbuy_alerter = StringConcatenate(Symbol()," ",Period()," Gann Value: ",ssl[0]);
Alert("Possible BUY ",Symbol()," ",Period()," Gann Value: ",ssl[0]);
SendMail("Gann: Possible BUY",""+pbuy_alerter);
}
if((Bid<ssl[0]) && (ssl[1]<=Open[1]) && (ssl[0]>=Close[0]))
{
string psell_alerter = StringConcatenate(Symbol()," ",Period()," Gann Value: ",ssl[0]);
Alert("Possible SELL ",Symbol()," ",Period()," Gann Value: ",ssl[0]);
SendMail("Gann: Possible SELL",""+psell_alerter);
}
}
}
if (Volume[0]==1) // On first tick of current bar only
{
if((Ask>ssl[1]) && (ssl[2]>=Open[2]) && (ssl[1]<=Close[1]))
{
string buy_alerter = StringConcatenate(Symbol()," ",Period()," Gann Value: ",ssl[0]);
SendMail("Gann: BUY",""+buy_alerter);
Alert("BUY ",Symbol(),Period()," Gann Value: ",ssl[1],Open[1],Close[1]);
}
if((Bid<ssl[1]) && (ssl[2]<=Open[2]) && (ssl[1]>=Close[1]))
{
string sell_alerter = StringConcatenate(Symbol()," ",Period()," Gann Value: ",ssl[0]);
SendMail("Gann: SELL",""+sell_alerter);
Alert("SELL ",Symbol(),Period()," Gann Value: ",ssl[1],Open[1],Close[1]);
}
}
//----
return(0);
}
//+--------------------------------------------------------------------
and second is:-
//+------------------------------------------------------------------+
//| PS DOT.mq4 |
//| PRAGNESH S PATEL |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "PRAGNESH S PATEL"
#property link "[email protected]"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Gold
extern int RISK = 4;
double g_ibuf_80[];
double g_ibuf_84[];
int gi_88 = 0;
int gi_92 = 0;
int init() {
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 2);
SetIndexArrow(0, 159);
SetIndexBuffer(0, g_ibuf_80);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 2);
SetIndexArrow(1, 159);
SetIndexBuffer(1, g_ibuf_84);
return (0);
}
int deinit() {
return (0);
}
int start() {
double ld_0;
double ld_8;
int l_count_16;
int li_20;
int li_24;
int li_28;
double ld_32;
double ld_40;
double ld_48;
double ld_56;
double lda_64[500][2];
double ld_68 = 10;
double ld_76 = 70;
double ld_84 = 30;
int li_92 = IndicatorCounted();
ld_68 = RISK * 2 + 3;
ld_76 = RISK + 67;
ld_84 = 33 - RISK;
double l_period_96 = ld_68;
if (li_92 < 0) return (-1);
if (li_92 > 0) li_92--;
int li_104 = Bars - li_92 - 1;
for (int li_108 = li_104; li_108 > 0; li_108--) {
li_20 = li_108;
ld_32 = 0;
ld_40 = 0;
for (li_20 = li_108; li_20 <= li_108 + 9; li_20++) ld_40 += MathAbs(High[li_20] - Low[li_20]);
ld_32 = ld_40 / 10.0;
li_20 = li_108;
l_count_16 = 0;
while (li_20 < li_108 + 9 && l_count_16 < 1) {
if (MathAbs(Open[li_20] - (Close[li_20 + 1])) >= 2.0 * ld_32) l_count_16++;
li_20++;
}
if (l_count_16 >= 1) li_24 = li_20;
else li_24 = -1;
li_20 = li_108;
l_count_16 = 0;
while (li_20 < li_108 + 6 && l_count_16 < 1) {
if (MathAbs(Close[li_20 + 3] - Close[li_20]) >= 4.6 * ld_32) l_count_16++;
li_20++;
}
if (l_count_16 >= 1) li_28 = li_20;
else li_28 = -1;
if (li_24 > -1) l_period_96 = 3;
else l_period_96 = ld_68;
if (li_28 > -1) l_period_96 = 4;
else l_period_96 = ld_68;
ld_0 = 100 - MathAbs(iWPR(NULL, 0, l_period_96, li_108));
lda_64[li_108][0] = li_108;
lda_64[li_108][1] = ld_0;
ld_48 = 0;
ld_56 = 0;
ld_8 = 0;
if (ld_0 < ld_84) {
for (int li_112 = 1; lda_64[li_108 + li_112][1] >= ld_84 && lda_64[li_108 + li_112][1] <= ld_76; li_112++) {
}
if (lda_64[li_108 + li_112][1] > ld_76) {
ld_8 = High[li_108] + ld_32 / 2.0;
ld_48 = ld_8;
}
}
if (ld_0 > ld_76) {
for (li_112 = 1; lda_64[li_108 + li_112][1] >= ld_84 && lda_64[li_108 + li_112][1] <= ld_76; li_112++) {
}
if (lda_64[li_108 + li_112][1] < ld_84) {
ld_8 = Low[li_108] - ld_32 / 2.0;
ld_56 = ld_8;
}
}
if (ld_56 != 0.0 && gi_88 == FALSE) {
g_ibuf_80[li_108] = ld_56 - 1.0 * Point;
gi_88 = TRUE;
gi_92 = FALSE;
if (li_104 <= 2) Alert(Symbol(), " ", Period(), "M Golden Finger BUY ");
}
if (ld_48 != 0.0 && gi_92 == FALSE) {
g_ibuf_84[li_108] = ld_48 + 1.0 * Point;
gi_92 = TRUE;
gi_88 = FALSE;
if (li_104 <= 2) Alert(Symbol(), " ", Period(), "M Golden Finger SELL ");
}
}
return (0);
}
thanks a lot if anyone can help me
Reply With Quote Multi-Quote This Message Quick reply to this message
#2 Add to worldastro's Appreciation Report Post
Old Today, 03:53 PM :thanx: