FigurSearcher

Author: FORTRADER.RU, ����, ftyuriy@gmail.com
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open orders
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
25.00 %
Total Trades 55132
Won Trades 11060
Lost trades 44072
Win Rate 0.20 %
Expected payoff -0.15
Gross Profit 2726.37
Gross Loss -10985.27
Total Net Profit -8258.90
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
FigurSearcher
//+------------------------------------------------------------------+
//|                                                FigurSearcher.mq4 |
//|                            FORTRADER.RU, Þðèé, ftyuriy@gmail.com |
//|                               http://FORTRADER.RU, Candlle+Price |
//+------------------------------------------------------------------+
/*Ðàçðàáîòàíî äëÿ 47 âûïóñêà æóðíàëà FORTRADER.Ru. Ñèñòåìà ðàñïîçíîâàíèÿ ñâå÷íûõ ïàòòåðíîâ. 
Îò÷åòû: http://finfile.ru//index.php/files/get/yHlrerfSr8/statement180509.zip
Ñåò ôàéëû: http://finfile.ru//index.php/files/get/kfClhP0ZsO/setfile180509.zip
Îáñóæäåíèå: http://fxnow.ru/group_discussion_view.php?group_id=49&grouptopic_id=214
Àðõèâ æóðíàëà: http://www.fortrader.ru/arhiv.php
 */
#property copyright "FORTRADER.RU, Þðèé, ftyuriy@gmail.com"
#property link      "http://FORTRADER.RU, Candlle+Price"

extern int A1=-2;
extern int A2=-2;
extern int B1=1;
extern int B2=1;
extern int C1=1;
extern int C2=1;

extern int nbT1=3;

extern int nbT2start=1;
extern int nbT2stop=3;

extern int nbT3start=1;
extern int nbT3stop=3;

extern int nbT4=1;

extern int SL=25;
extern int TP=25;
extern int mn=1;

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

extern int type=1;

int start()
{
double T1=Open[nbT1];
double T2=High[iHighest(NULL,0,MODE_HIGH,nbT2stop,nbT2start)];
double T3=Low[iLowest(NULL,0,MODE_LOW,nbT3stop,nbT3start)];
double T4=Close[nbT4];


double K1=searchnumbars(1,T2,nbT2start,nbT2stop)-searchnumbars(0,T3,nbT3start,nbT3stop);
double K2=(T2-T3)/(T1-T3);
double K3=(T2-T3)/(T4-T3);

int err;
double op,sl,tp;
  
   if(A1<K1 && K1>A2 && B1<K2 && K2>B2 && C1<K3 && K3>C2  && timecontrol()==1 && type==1)
   {
      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);}
   }
   
   if(A1<K1 && K1>A2 && B1<K2 && K2>B2 && C1<K3 && K3>C2 && ChPos(0)==0 && timecontrol()==1 && type==0)
   {
     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);}

   }


 
 return(0);
}

//Ïîèñê íîìåðà áàðà ïî öåíå
int searchnumbars(int type, double price, int start, int stop)
{//Ïîäðîáíîå îïèñàíèå http://fxnow.ru/blog.php?user=Yuriy&blogentry_id=114
int i;
   if(type==1)
   {
      for(i=nbT2start; i<=nbT2stop;i++)
      {
      if(High[i]==price){return(i);}
      }
   }
      if(type==0)
   {
      for(i=start; i<=stop;i++)
      {
      if(Low[i]==price){return(i);}
      }
   }
return(-1);
}

 //ïðîâåðÿåò åñòü ëè îòêðûòûå îðäåðà
int ChPos(int type) 
{//ïîäðîáíîå îïèñàíèå: http://fxnow.ru/blog.php?user=Yuriy&blogentry_id=100

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

extern int time=0; //1 - âêëþ÷åíî, 0 - âûêëþ÷åíî.
extern int starttime = 7; 
extern int stoptime = 17; 

//Îãðàíè÷åíèå ïî âðåìåíè
int timecontrol()
{// Ïîäðîáíîå îïèñàíèå http://fxnow.ru/blog.php?user=Yuriy&blogentry_id=1
   if ( ( (Hour()>=0 && Hour()<=stoptime-1) ||  (Hour()>=starttime && Hour()<=23)) && starttime>stoptime)
      {
      return(1);
      }  
      if ( (Hour()>=starttime && Hour()<=stoptime-1) && starttime<stoptime)
      {
      return(1);
      }  
      
   if(time==0){ return(1);}
     
return(0);
}

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---