Author: Copyright � 2008, MetaQuotes Software Corp.
0 Views
0 Downloads
0 Favorites
teste-v2
//+------------------------------------------------------------------+
//|                                                     teste-v1.mq4 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

extern double Lots=0.1;
extern double Lots1=0.2;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{

// first condition:
if ( NewBar() == true )
if ( Low[1] - 1*Point == Low[2] ) 
{
OrderSend (Symbol(),OP_BUY,Lots,Ask,10,Ask-
35*Point,Ask+100*Point,0,Green);
SendMail ("Buyit1", "Test" );
}

else// second condition:
if ( Low[1] == Low[2] ) 
{
OrderSend (Symbol(),OP_BUY,Lots1,Ask,10,Ask-
35*Point,Ask+100*Point,0,Red);
SendMail ("Buyit2", "Test" );
}

return;

}
bool NewBar()

{ static datetime lastbar = 0;
datetime curbar = Time[0];

if (lastbar != curbar)
{ lastbar = curbar;

return(true); }

else
{
return(false); }
}

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