Author: Copyright � 2005, MetaQuotes Software Corp.
Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Bulls Power indicator Bears Power indicator
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
34.00 %
Total Trades 19
Won Trades 16
Lost trades 3
Win Rate 0.84 %
Expected payoff -132.63
Gross Profit 1280.00
Gross Loss -3800.00
Total Net Profit -2520.00
-100%
-50%
0%
50%
100%
sistem4
//+------------------------------------------------------------------+
//|                                                   ÌîÿÑèñòåìà.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. | ÈÑÏÎËÜÇÎÂÀÒÜ ÍÀ 15 ÌÈÍÓÒÊÀÕ
//|                                        http://www.metaquotes.net | Ñ ÝÒÈÌÈ ÏÀÐÀÌÅÒÐÀÌÈ ÍÀ EURUSD - Serg.
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//---- input parameters
extern double TakeProfit = 4;
extern double Lots = 20;
extern double StopLoss = 80;
extern int TimeOpen = 2;
extern int p1=13;
extern int p2=14;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int start(){

double pos1pre, pos2cur;
int cnt, ticket, total,TotalOpenOrders;
int mode,TP;

string apos1,apos;

double pp131,pp132,pp141,pp142,pb131,pb132,pb141,pb142;
string aa131,aa132,aa141,aa142,ab131,ab132,ab141,ab142,aa;

int min_stop=MarketInfo(Symbol(),MODE_STOPLEVEL);

pos1pre = iBullsPower(NULL, 0, 13,PRICE_WEIGHTED,3);
pos2cur = iBullsPower(NULL, 0, 13,PRICE_WEIGHTED,4);
// 3 4 1662 80 80
// 3 5 1058 80 60

apos1 = DoubleToStr(pos1pre*10000,2) + "  ";
apos1 = apos1 + " | " + DoubleToStr(pos2cur*10000,2) + "  ";
apos1 = apos1 + " | " + DoubleToStr((pos1pre - pos2cur)*10000,2) + "  ";

// áûëî 1 0 à ñòàëî 3 4
pp131 = iBullsPower(NULL, 0,13,PRICE_WEIGHTED,3); pp132 = iBullsPower(NULL, 0,13,PRICE_WEIGHTED,4);
pp141 = iBullsPower(NULL, 0,14,PRICE_WEIGHTED,3); pp142 = iBullsPower(NULL, 0,14,PRICE_WEIGHTED,4);
pb131 = iBearsPower(NULL, 0,13,PRICE_WEIGHTED,3); pb132 = iBearsPower(NULL, 0,13,PRICE_WEIGHTED,4);
pb141 = iBearsPower(NULL, 0,14,PRICE_WEIGHTED,3); pb142 = iBearsPower(NULL, 0,14,PRICE_WEIGHTED,4);


aa = " íåò      "; if (pp131 > pp132 && pp132 !=0 ) {aa = " YES SELL  " + DoubleToStr((pp131-pp132)*10000,2) + "  ";}
aa131 = "Áûêè ï13 ñèãíàë Sell = " + aa ;
aa = " íåò      "; if (pp131 < pp132 && pp132 < 0)  {aa = " YES BUY!  " + DoubleToStr((pp131-pp132)*10000,2) + "  ";}
aa132 = " ñèãíàë Buy = " + aa ;

aa = " íåò      "; if (pp141 > pp142 && pp132 !=0 ) {aa = " YES SELL  " + DoubleToStr((pp141-pp142)*10000,2) + "  ";}
aa141 = "Áûêè ï14 ñèãíàë Sell = " + aa ;
aa = " íåò      "; if (pp141 < pp142 && pp142 < 0)  {aa = " YES BUY! " + DoubleToStr((pp141-pp142)*10000,2) + "  ";}
aa142 = " ñèãíàë Buy = " + aa ;


aa = " íåò      "; if (pb131 > pb132 && pb132 !=0) {aa = " YES SELL  " + DoubleToStr((pb131-pb132)*10000,2) + "  ";}
ab131 = "Ìåäâ ï13 ñèãíàë Sell = " + aa ;
aa = " íåò      "; if (pb131 < pb132 && pb132 < 0) {aa = " YES BUY!  " + DoubleToStr((pb131-pb132)*10000,2) + "  ";}
ab132 = " ñèãíàë Buy = " + aa ;
aa = " íåò      "; if (pb141 > pb142 && pb142 !=0) { aa = " YES SELL  " + DoubleToStr((pb141-pb142)*10000,2) + "  ";}
ab141 = "Ìåäâ ï14 ñèãíàë Sell = " + aa ;
aa = " íåò      "; if (pb141 < pb142 && pp142 < 0) {aa = " YES BUY!  " + DoubleToStr((pb141-pb142)*10000,2) + "  ";}
ab142 = " ñèãíàë Buy = " + aa ;



Comment(apos1,"\n",aa131,aa132,"\n",aa141,aa142,"\n",ab131,ab132,"\n",ab141,ab142,"\n");


// ñ÷èòàåì êîëâî îòêðûòûõ îðäåðîâ    

  total=OrdersTotal();
  TotalOpenOrders = 0;
  for(cnt=0; cnt<total; cnt++)
  {
    if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) == true) 
    {
      if (OrderSymbol()==Symbol())
      {
        if(OrderType()==OP_BUY || OrderType()==OP_SELL) TotalOpenOrders = TotalOpenOrders+1;
        if(OrderType()==OP_BUY)
        {
          if(TakeProfit<=min_stop && Bid>=OrderOpenPrice()+TakeProfit*Point)
          { OrderClose(OrderTicket(),OrderLots(),Bid,3); }
        }
        if(OrderType()==OP_SELL)
        {
          if(TakeProfit<=min_stop && Ask<=OrderOpenPrice()-TakeProfit*Point)
          { OrderClose(OrderTicket(),OrderLots(),Ask,3); }
        }
      }
    }
  }

  if(TimeOpen>=60 || TimeOpen<0) TimeOpen=0;

  TP=TakeProfit;
  if(TakeProfit<=min_stop) TP=min_stop+3;

  if(TotalOpenOrders<1)
  {
    if(pos1pre>pos2cur && pos2cur!=0)
    {
      if(TimeOpen==0)
        OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TP*Point,NULL,0,0,Red);
      else if(TimeMinute(CurTime())>60-TimeOpen)
        OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TP*Point,NULL,0,0,Red);
    }

    if(pos1pre<pos2cur && pos2cur<0)
    {
      if(TimeOpen==0)
        OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TP*Point,NULL,0,0,Aqua);
      else if(TimeMinute(CurTime())>60-TimeOpen)
        OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TP*Point,NULL,0,0,Aqua);
    }
  }

//---- 
//----
   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 ---