_FT_Fractal_MA

Author: FORTRADER.RU, ����, ftyuriy@gmail.com
Profit factor:
0.54
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open orders
Indicators Used
FractalsMoving average indicator
10 Views
0 Downloads
0 Favorites
_FT_Fractal_MA
//+------------------------------------------------------------------+
//|                                                FT_Fractal_MA.mq4 |
//|                            FORTRADER.RU, Þðèé, ftyuriy@gmail.com |
//|                          http://FORTRADER.RU, Ôðàêòàëû + Ñðåäíèå |
//+------------------------------------------------------------------+
#property copyright "FORTRADER.RU, Þðèé, ftyuriy@gmail.com"
#property link      "http://FORTRADER.RU, Ôðàêòàëû + Ñðåäíèå"

/*Ðàçðàáîòàíî äëÿ 49 âûïóñêà æóðíàëà FORTRADER.Ru. Ñèñòåìà ïî ôðàêòàëàì è ñðåäíåé. 
Îò÷åòû: http://finfile.ru/index.php/files/get/6qQW8tgENy/fracralma1.zip , http://finfile.ru/index.php/files/get/_glRYiHkQi/fracralma2.zip
Ñåò ôàéëû: http://finfile.ru/index.php/files/get/k2w2e92iCI/eurusd1h.zip
Îáñóæäåíèå: http://fxnow.ru/group_discussion_view.php?group_id=49&grouptopic_id=266&grouppost_id=2667#post_2667
Àðõèâ æóðíàëà: http://www.fortrader.ru/arhiv.php
49 âûïóñê: http://www.fortrader.ru/
*/

extern int lwmaper1=4;
extern int lwmaper2=8;

extern int lwmapertrend=40;
extern int lwmatrendchart=1;

extern int SL=150;
extern int TP=150;

extern int mn=1;

int err;

extern int MG=564651;
extern double Lots=0.01;

extern int maxpos=1;

int bars;
int start()
{
  if(bars!=Bars)
  {   
      bars=Bars;
      OpenPattern();
  }
return(0);
}

int okbuy,oksell;

int OpenPattern()
  {
  double op,sl,tp;
  
  double upf=iFractals(NULL, 0, MODE_UPPER, 3);
  double dwf=iFractals(NULL, 0, MODE_LOWER, 3);
  
  double lwma1=iMA(NULL,0,lwmaper1,0,MODE_LWMA,PRICE_CLOSE,1);
  double lwma2=iMA(NULL,0,lwmaper2,0,MODE_LWMA,PRICE_CLOSE,1);
  double lwma1Last=iMA(NULL,0,lwmaper1,0,MODE_LWMA,PRICE_CLOSE,2);
  double lwma2Last=iMA(NULL,0,lwmaper2,0,MODE_LWMA,PRICE_CLOSE,2);
  double lwmatrend=iMA(NULL,GetPeriod(lwmatrendchart),lwmapertrend,0,MODE_LWMA,PRICE_CLOSE,1);
  double lwmatrendLast=iMA(NULL,0,GetPeriod(lwmatrendchart),0,MODE_LWMA,PRICE_CLOSE,2);
  
  if(upf!=0){oksell=1;okbuy=0;}
  if(dwf!=0){okbuy=1;oksell=0;}
  
  if(oksell==1 && lwma1<lwma2 && lwma1Last>lwma2Last && CountPos(0)<maxpos && lwmatrend>lwmatrendLast)
  {
   op=Bid;if(SL>0){sl=Bid+SL*Point*mn;}if(TP>0){tp=Bid-TP*Point*mn;}
   err=OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(op,Digits),3,NormalizeDouble(sl,Digits),NormalizeDouble(tp,Digits),"4 FORTRADER.RU",MG,0,Red);
   if(err<0){Print("OrderSend()-  Îøèáêà OP_SELL.  op "+op+" sl "+sl+" tp "+tp+" "+GetLastError());return(-1);}
   oksell=0;
  }
  
  if(okbuy==1 && lwma1>lwma2 && lwma1Last<lwma2Last && CountPos(1)<maxpos && lwmatrend<lwmatrendLast)
  {
   op=Ask;if(SL>0){sl=Ask-SL*Point*mn;}if(TP>0){tp=Ask+TP*Point*mn;}
   err=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(op,Digits),3,NormalizeDouble(sl,Digits),NormalizeDouble(tp,Digits),"6 FORTRADER.RU",MG,0,Red);
   if(err<0){Print("OrderSend()-  Îøèáêà OP_BUY.  op "+op+" sl "+sl+" tp "+tp+" "+GetLastError());return(-1);}
   okbuy=0;
  }
  
 return(err);
 }
  
//Ïðîâåðÿåì êîëè÷åñâòî ïîçèöèé.
int CountPos(int type) 
{//Îïèñàíèå http://fxnow.ru/blog.php?user=Yuriy&blogentry_id=66

int i;
int col;
int count=0 ;
for( i=0; i<=OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS)==true)
{
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && type==1 && OrderMagicNumber()==MG){count++;}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && type==0 && OrderMagicNumber()==MG){count++;}
}
} 
return(count);
}

int GetPeriod(int GrafOpen)
{int GrafOpenT;
 switch(GrafOpen)
  {
   case 1: GrafOpenT=1;break;
   case 2: GrafOpenT=5;break;
   case 3: GrafOpenT=15;break;
   case 4: GrafOpenT=30;break;
   case 5: GrafOpenT=60;break;
   case 6: GrafOpenT=240;break;
   case 7: GrafOpenT=1440;break;
   default: GrafOpenT=1;break;
  }
return(GrafOpenT);
}

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
0.50
Total Trades 142
Won Trades 47
Lost trades 95
Win Rate 33.10 %
Expected payoff -0.34
Gross Profit 47.91
Gross Loss -96.59
Total Net Profit -48.68
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.70
Total Trades 120
Won Trades 49
Lost trades 71
Win Rate 40.83 %
Expected payoff -0.33
Gross Profit 91.88
Gross Loss -131.60
Total Net Profit -39.72
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.80
Total Trades 119
Won Trades 53
Lost trades 66
Win Rate 44.54 %
Expected payoff -0.12
Gross Profit 57.73
Gross Loss -72.11
Total Net Profit -14.38
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.62
Total Trades 94
Won Trades 36
Lost trades 58
Win Rate 38.30 %
Expected payoff -0.35
Gross Profit 54.00
Gross Loss -87.00
Total Net Profit -33.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.70
Total Trades 130
Won Trades 53
Lost trades 77
Win Rate 40.77 %
Expected payoff -0.27
Gross Profit 79.50
Gross Loss -114.33
Total Net Profit -34.83
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.02
Total Trades 134
Won Trades 3
Lost trades 131
Win Rate 2.24 %
Expected payoff -1.02
Gross Profit 3.21
Gross Loss -140.36
Total Net Profit -137.15
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.08
Total Trades 104
Won Trades 8
Lost trades 96
Win Rate 7.69 %
Expected payoff -0.83
Gross Profit 7.82
Gross Loss -93.68
Total Net Profit -85.86
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.83
Total Trades 108
Won Trades 49
Lost trades 59
Win Rate 45.37 %
Expected payoff -0.14
Gross Profit 73.50
Gross Loss -88.50
Total Net Profit -15.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.55
Total Trades 102
Won Trades 36
Lost trades 66
Win Rate 35.29 %
Expected payoff -0.44
Gross Profit 54.00
Gross Loss -98.56
Total Net Profit -44.56
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
1.00
Total Trades 82
Won Trades 41
Lost trades 41
Win Rate 50.00 %
Expected payoff 0.00
Gross Profit 43.87
Gross Loss -43.85
Total Net Profit 0.02
-100%
-50%
0%
50%
100%

Comments