You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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