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