Author: Copyright 2012, MetaQuotes Software Corp.
Orders Execution
Checks for the total of open orders
0 Views
0 Downloads
0 Favorites
000000-15
//+------------------------------------------------------------------+
//|                                                000  000 - 15.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
//+------------------------------------------------------------------+
// Âíåøíèå ïåðåìåííûå:

extern double ll=1;

extern int tp=20;

int        last_bar    = 0;

int start()
   {
double StopLevel =MarketInfo(Symbol(),MODE_STOPLEVEL);  // òåêóùèé óðîâåíü ñòîïîâ  

   if (last_bar == Bars) return(0);
   last_bar = Bars;
   if (OrdersTotal() == 0)
   {
   OrderSend (Symbol(),OP_BUYLIMIT,ll*1,Ask-10*Point,0,0,Ask+Point*tp); 
   OrderSend (Symbol(),OP_BUYSTOP,ll*1,Ask+10*Point,0,0,Ask+Point*tp);
   }
   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 ---