chenzi需要的公式
大家也看看,反正枪口都是对准鬼子的。:lol
算法:
Var1:=(H+L+O+C)/4;
Var2:=2*EMA(LLV(Var1,7),10)-Var1;
提前量: 3*Var2-2*SMA(Var2,10,1)+0.05*C,colorgreen;
意思是变量1赋值:(最高价+最低价+开盘价+收盘价)/4
变量2赋值:2*EMA(7日内VAR1的最低值,10)- 变量1
提前量:3*变量2-2*SMA(变量2,10,1)+0.05*收盘价,画绿色
(SMA括号内的1表示的是权重是1)
//+------------------------------------------------------------------+
//| chenzi.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightGreen
extern int VarLow=7;
extern int VarEma=10;
extern int VarSma=10;
double Buffer1;
double Buffer2;
double Buffer3;
double TQ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(4);
SetIndexBuffer(0, TQ);
SetIndexBuffer(1, Buffer1);
SetIndexBuffer(2, Buffer2);
SetIndexBuffer(3, Buffer3);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0, TQ);
IndicatorShortName("CHENZI("+VarLow+","+VarEma+","+VarSma+")");
SetIndexLabel(0,"TQ");
SetIndexDrawBegin(0,VarEma);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,k,limit;
double min,price;
//----
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=0;i=0)
{min=Buffer1;
k=i+VarLow-1;
while(k>=i)
{price=Buffer1[k];
if(min>price) min=price;
k--;
}
Buffer2=min;
i--;
}
limit=Bars-counted_bars-VarLow;
for(i=0;i
发表于:2005-07-25 02:34只看该作者
2楼
hawkie这个指标是使用在主图上的,请修改一下
韬客社区www.talkfx.co
3楼
你把公式里面的#property indicator_separate_window
替换成#property indicator_chart_window
就可以在主图显示了。
不过在主图显示后看起来很乱。
发表于:2005-07-26 04:21只看该作者
4楼
能不能抓个图来看看
韬客社区www.talkfx.co