_DEL_ONE_ORDER

Author: Copyright � 2009, MetaQuotes Software Corp.
Orders Execution
Checks for the total of open orders
Miscellaneous
It issuies visual alerts to the screenIt plays sound alerts
0 Views
0 Downloads
0 Favorites
_DEL_ONE_ORDER
//+------------------------------------------------------------------+
//|                                               _DEL_ONE_ORDER.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
  int stlw=MarketInfo(Symbol(),MODE_STOPLEVEL);
  int spr =MarketInfo(Symbol(),MODE_SPREAD);  
  double prise=WindowPriceOnDropped();
  if(prise==0){
    Alert("Öåíà íå îïðåäåëåíà!");
    return;
  } 
  for(int i=0;i<OrdersTotal();i++){
    if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
      if(OrderSymbol()==Symbol()){
        if(OrderType()>1){
          if(OrderCloseTime()==0){
            if(MathAbs(OrderOpenPrice()-prise)<spr*Point*2){
              if(!OrderDelete(OrderTicket())){
                Alert("Îøèáêà çàêðûòèÿ ¹",GetLastError());
              }else{PlaySound("expert.wav");}
            }
          }  
        }
      }
    }
  }  
  
   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 ---