//+------------------------------------------------------------------+
//| 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()
//----
I just added print statements in init,start and deinit functions.
It prints "Hi in init" and then says initialized but doesnt go inside start function at all.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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:28 try 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()
//----
}
//+------------------------------------------------------------------+
I just added print statements in init,start and deinit functions.
It prints "Hi in init" and then says initialized but doesnt go inside start function at all.
What could be the problem?
Thanx for Help
Sunny