预定义变量[Pre-defined Variables]
double Ask
通货的买入价
示例:
if(iRSI(NULL,0,14,PRICE_CLOSE,0)<25)
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,
"My order #2",3,D' 12:30',Red);
return;
}
int Bars
返回图表中的柱数
示例:
int counter=1;
for(int i=1;i<=Bars;i++)
{
Print(Close[i-1]);
}
double Bid
通货的卖价
示例:
if(iRSI(NULL,0,14,PRICE_CLOSE,0)>75)
{
OrderSend("EURUSD",OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
"My order #2",3,D' 12:30',Red);
return(0);
}
double Close[]
返回指定索引位置的收盘价格
示例:
int handle, bars=Bars;
handle=FileOpen("",FILE_CSV|FILE_WRITE,';');
if(handle>0)
{
// write table columns headers
FileWrite(handle, "Time;Open;High;Low;Close;Volume");
// write data
for(int i=0; i
FileWrite(handle, Time[i],
Open[i], High[i], Low[i], Close[i], Volume[i]);
FileClose(handle);
}
int Digits
返回当前通货的汇率小数位
示例:
Print(DoubleToStr(Close[i-1], Digits));
double High[]
返回指定索引位置的最高价格
示例:
int handle, bars=Bars;
handle=FileOpen("", FILE_CSV|FILE_WRITE, ';');
if(handle>0)
{
// write table columns headers
FileWrite(handle, "Time;Open;High;Low;Close;Volume");
// write data
for(int i=0; i
FileWrite(handle, Time[i], Open[i], High[i], Low[i], Close[i], Volume[i]);
FileClose(handle);
}
double Low[]
返回指定索引位置的最低价格
示例:
int handle, bars=Bars;
handle=FileOpen("", FILE_CSV|FILE_WRITE, ";");
if(handle>0)
{
// write table columns headers
FileWrite(handle, "Time;Open;High;Low;Close;Volume");
// write data
for(int i=0; i
FileWrite(handle, Time[i], Open[i], High[i], Low[i], Close[i], Volume[i]);
FileClose(handle);
}
double Open[]
返回指定索引位置的开盘价格
示例:
int handle, bars=Bars;
handle=FileOpen("", FILE_CSV|FILE_WRITE, ';');
if(handle>0)
{
// write table columns headers
FileWrite(handle, "Time;Open;High;Low;Close;Volume");
// write data
for(int i=0; i
FileWrite(handle, Time[i], Open[i], High[i], Low[i], Close[i], Volume[i]);
FileClose(handle);
}
doubl
MT4常用函数变量说明 来自淘豆网m.daumloan.com转载请标明出处.