INFORMER-ICQ

Orders Execution
Checks for the total of open orders
0 Views
0 Downloads
0 Favorites
INFORMER-ICQ
//===============================================================================
extern string MOFT="http://tesvop.narod.ru/indexmag.html"
//===============================================================================
extern string Period_ ="Óêàçûâàòü â ìèíóòàõ";
extern int Periodichnost = 10;
#include <DataExchange.mqh>          // Áèáëèîòåêà îò ïðîãðàììêè îáÿçàòåëüíà

int start()
  {
  int per=Periodichnost*60000;
//===============================================================================
//                    Ñ÷èòàåì âñå îðäåðà
//===============================================================================
   int total=OrdersTotal();
   int b=0,s=0, n=0, bl=0,sl=0, bs=0,ss=0,b2=0,s2=0;
   for (int i=total; i>=0; i--)
   {if(OrderSelect(i, SELECT_BY_POS))
   {
    if (OrderSymbol()==Symbol())
   {n++;
//===============================================================================
      if (OrderType()==OP_BUY ){b++  ;}
      if (OrderType()==OP_SELL){s++  ;}
      if (OrderType()==OP_SELLSTOP ){ss++  ;}
      if (OrderType()==OP_BUYSTOP  ){bs++  ;}
      if (OrderType()==OP_SELLLIMIT){sl++  ;}
      if (OrderType()==OP_BUYLIMIT ){bl++  ;}
}}}
//===============================================================================
double prib = 0;   int zzz=0;
   for (int uuui=total-1; uuui>=0; uuui--)                                 
   {if(OrderSelect(uuui, SELECT_BY_POS))                          
   {
    if (OrderSymbol()==Symbol())
   {double  pri=OrderProfit();
    prib=prib+pri;
    zzz++;}}}
//===============================================================================
string ferte = DoubleToStr(AccountBalance(),2);
string fser  = DoubleToStr(prib,2);
_icqmessage[0]="===ÎÁÙÅÅ ÈÍÔÎ Î Ñ×ÅÒÅ===";
_icqmessage[1]="ÏÀÐÀ                  ==  "+Symbol();
_icqmessage[2]="ÎÐÄÅÐÎÂ  BUY     ==  "+b;
_icqmessage[3]="ÎÐÄÅÐÎÂ  SELL    ==  "+s; 
_icqmessage[4]="ÎÐÄÅÐÎÂ  SL      ==  "+sl;
_icqmessage[5]="ÎÐÄÅÐÎÂ  BL       ==  "+bl;
_icqmessage[6]="ÎÐÄÅÐÎÂ  ÂÑÅÃÎ ==  "+n; 
_icqmessage[7]="ÁÀËÀÍÑ              ==  "+ferte+"  "+AccountCurrency();
_icqmessage[8]="ÏÐÎÔÈÒ              ==  "+fser+"  "+AccountCurrency();
_icqmessage[9]="ÏÅÐÈÎÄ              ==  "+Periodichnost+"  Ìèí";
//===============================================================================
SendIcq(1);
SendIcq(2);
SendIcq(3);
SendIcq(4);
SendIcq(5);
SendIcq(6);
SendIcq(7);
SendIcq(8);
SendIcq(9);
SendIcq(10);
//===============================================================================
//===============================================================================
Sleep(per);
Comment("ÏÅÐÂÎÅ ÎÔÔÈÖÈÀËÜÍÎÅ ÑÎÎÁÙÅÑÒÂÎ ÒÐÅÉÄÅÐÎÂ  ""ÌÎÔÒ",
"\n","http://tesvop.narod.ru/indexmag.html""");
   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 ---