下载MetaTrader 5
要添加评论,请登录注册
找不到正确的应用程序?订购它!
wuzuwang
57
wuzuwang 2007.10.08 09:37 

您好!

请问我下面的定义对吗?为什么编写的时候提示错误:'MarketInfo' - initialization expected C:\Program Files\MetaTrader - North Finance\experts\final. mq4 (1, 19)

'A' - variable not defined C:\Program Files\MetaTrader - North Finance\experts\final. mq4 (11, 12)

extern double A = MarketInfo("EURUSD",MODE_BID);
extern double B = MarketInfo("USDJPY",MODE_BID);
extern double C = MarketInfo("EURJPY",MODE_BID);

int start()
{
...



}

//

期待回复

谢谢~!

Rashid Umarov
管理员
6606
Rashid Umarov 2007.10.08 11:53  
Do it

double A = MarketInfo("EURUSD",MODE_BID);
doube B = MarketInfo("USDJPY",MODE_BID);
double C = MarketInfo("EURJPY",MODE_BID);
 
init()
{
A = MarketInfo("EURUSD",MODE_BID);
B = MarketInfo("USDJPY",MODE_BID);
C = MarketInfo("EURJPY",MODE_BID);
}
int start()
  {
 ...
 
 
 
 }
wuzuwang
57
wuzuwang 2007.10.08 12:25  
Rosh:
Do it

double A = MarketInfo("EURUSD",MODE_BID);
doube B = MarketInfo("USDJPY",MODE_BID);
double C = MarketInfo("EURJPY",MODE_BID);
 
init()
{
A = MarketInfo("EURUSD",MODE_BID);
B = MarketInfo("USDJPY",MODE_BID);
C = MarketInfo("EURJPY",MODE_BID);
}
int start()
  {
 ...
 
 
 
 }
Thanks a lot!

wuzuwang
57
wuzuwang 2007.10.08 13:32  
wuzuwang:
Thanks a lot! 但是好像还不行:
double A = MarketInfo("EURUSD",MODE_BID);
double B = MarketInfo("USDJPY",MODE_BID);
double C = MarketInfo("EURJPY",MODE_BID);
init()
{
   A=MarketInfo("EURUSD",MODE_BID);
    B=MarketInfo("USDJPY",MODE_BID);
    C=MarketInfo("EURJPY",MODE_BID);
} int start()
  {.....}
这里列举了其中几个错误。
'MarketInfo' - initialization expected C:\Program Files\MetaTrader - North Finance\experts\final.mq4 (2, 12)
'(' - comma or semicolon expected C:\Program Files\MetaTrader - North Finance\experts\final.mq4 
')' - unbalanced right parenthesis C:\Program Files\MetaTrader - North Finance\experts\final. mq4 (2, 39)
'init' - expression on global scope not allowed C:\Program Files\MetaTrader - North Finance\experts\final.mq4 (7, 1)
'A' - variable not defined C:\Program Files\MetaTrader - North Finance\experts\final. mq4 (9, 4)
......
到底哪里出问题了呢??





wuzuwang
57
wuzuwang 2007.10.08 16:11  
Rashid Umarov
管理员
6606
Rashid Umarov 2007.10.09 09:32  
Sorry. This was mistape.

double A;
double B;
double C;
 
init()
{
A = MarketInfo("EURUSD",MODE_BID);
B = MarketInfo("USDJPY",MODE_BID);
C = MarketInfo("EURJPY",MODE_BID);
}
int start()
  {
 ...
 
 
 
 }
okwh
1630
okwh 2007.10.10 03:54  

MarketInfo is function, only can use it inside codes( init, start et,), not used at declare region.

guangxing
6
guangxing 2009.03.23 12:14  

MarketInfo("GBPUSD", MODE_BID)

这样的语句是什么意思

okwh
1630
okwh 2009.03.24 05:14  
获取 GBPUSD的当前BID价
/
要添加评论,请登录注册