下载MetaTrader 5

求助关于MarketInfo("EURUSD",MODE_BID)

要添加评论,请登录注册
wuzuwang
60
wuzuwang  

您好!

请问我下面的定义对吗?为什么编写的时候提示错误:'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
管理员
12611
Rashid Umarov  
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
60
wuzuwang  
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
60
wuzuwang  
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
60
wuzuwang  
Rashid Umarov
管理员
12611
Rashid Umarov  
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
1637
okwh  

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

guangxing
6
guangxing  

MarketInfo("GBPUSD", MODE_BID)

这样的语句是什么意思

okwh
1637
okwh  
获取 GBPUSD的当前BID价
要添加评论,请登录注册