|
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
double 金银比[];
int init()
{
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,金银比);
SetIndexLabel(0,"金银比");
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{
金银比[i]=iClose("XAGUSD",0,i)/ iClose("XAUUSD",0,i)*100;
}
return(0);
} |
|