Hi Fellas
I m learning to code MQL in MT4. I m trying this simple program to market buy.
In the experts window i just see
"2009.06.15 13:32:28try EURUSD,M5: initialized"
nothing happens after that. Not even any error message.
This is the program in question:
#property copyright "Copyright 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double bid =MarketInfo("GBPUSD",MODE_BID); // Request for the value of Bid
double ask =MarketInfo("GBPUSD",MODE_ASK); // Request for the value of Ask
double point =MarketInfo("GBPUSD",MODE_POINT);//Request for Point
OrderSend("GBPUSD",OP_BUY,0.1,ask,3,bid-15*point,bid+15*point);
Print("There was an error: ",GetLastError());
Alert(GetLastError());
return(0);
// Exit start()
//----
}
//+------------------------------------------------------------------+
Thanx for Help
Sunny
I m learning to code MQL in MT4. I m trying this simple program to market buy.
In the experts window i just see
"2009.06.15 13:32:28try EURUSD,M5: initialized"
nothing happens after that. Not even any error message.
This is the program in question:
#property copyright "Copyright 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double bid =MarketInfo("GBPUSD",MODE_BID); // Request for the value of Bid
double ask =MarketInfo("GBPUSD",MODE_ASK); // Request for the value of Ask
double point =MarketInfo("GBPUSD",MODE_POINT);//Request for Point
OrderSend("GBPUSD",OP_BUY,0.1,ask,3,bid-15*point,bid+15*point);
Print("There was an error: ",GetLastError());
Alert(GetLastError());
return(0);
// Exit start()
//----
}
//+------------------------------------------------------------------+
Thanx for Help
Sunny