初来乍到,请教各位.
我有两个飞狐公式,麻烦各位不吝赐教,帮我转换成MT的指标.第一个是副图指标.小弟在此谢过了.
第一个是KDJ变形
N1: 60,1,200            N2:10,1,60
RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
RSV1:=(CLOSE-LLV(LOW,N2))/(HHV(HIGH,N2)-LLV(LOW,N2))*100;
K1:=SMA(RSV1,3,1);
D1:=SMA(K1,3,1);
q:k-50;
kK:k-k1;
a:0,colorgreen;
第二个是"搏杀生命线",是主图指标.
FL:MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1)),colorgreen;
FS:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
CG:IF(MA(CLOSE,17)fs,fs),colorgreen; talk2.GIF
talk2.GIF TALK1.GIF
TALK1.GIF 
 talk2.GIF
talk2.GIF TALK1.GIF
TALK1.GIF2楼 
顶
韬客社区www.talkfx.co
发表于:2005-07-28 10:09只看该作者
3楼 
你第一个公式
N1: 60,1,200            N2:10,1,60
RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
RSV1:=(CLOSE-LLV(LOW,N2))/(HHV(HIGH,N2)-LLV(LOW,N2))*100;
K1:=SMA(RSV1,3,1);
D1:=SMA(K1,3,1);
q:k-50;
kK:k-k1;
a:0,colorgreen;
里面看D,D1后面都没有用到,计算做什么用呢?
4楼 
呵呵,你不说我还没注意,真的没什么用.我只是在飞狐内用KDJ改的,所以忘记删除踏了.
韬客社区www.talkfx.co
5楼 
其实第二个如果很难编写的话有一个近似的公式,如下.我看了一下,效果差不多的.
CG:ma(C,17);
FL:hhv(CG,2);
FS:CG-(FL-CG);
韬客社区www.talkfx.co
发表于:2005-07-28 10:44只看该作者
6楼 
第一个公式,mt4代码
//+------------------------------------------------------------------+
//|                                                    BENBEN-KD.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 2
#property  indicator_color1  Silver
#property  indicator_color2  Yellow
extern int N1=60;
extern int N2=10;
double buffer1;
double buffer2;
double buffer3;
double buffer4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(4);
   SetIndexBuffer(0, buffer3);
   SetIndexBuffer(1, buffer4);
   SetIndexBuffer(2, buffer1);
   SetIndexBuffer(3, buffer2);
   
   
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   
   IndicatorShortName("BENBEN-KD("+N1+","+N2+")");
   SetIndexLabel(0,"Q");
   SetIndexLabel(1,"KK");
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i,limit;
//---- 
   limit=Bars-counted_bars;
   for(i=0;i
7楼 
多谢hawkie 大侠!
韬客社区www.talkfx.co


















