找回密码
 注册
搜索
楼主: Cobra

[放炮] 我会逐步向大家介绍该书中,我重点使用的部份,希望大家都能掌握!

  [复制链接]
发表于 2010-8-18 09:05 PM | 显示全部楼层


万岁
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-18 09:17 PM | 显示全部楼层
DTosc

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
#property copyright ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_color1 Red
#property indicator_color2 LimeGreen
#property indicator_width1 1
#property indicator_style1 0
#property indicator_width2 1
#property indicator_style2 2
#property indicator_level1 20
#property indicator_level2 50
#property indicator_level3 80
//
//
//
//
//

   extern int PeriodRSI  =13;
   extern int PeriodStoch= 8;
   extern int PeriodSK   = 5;
   extern int PeriodSD   = 3;
         //    0 = SMA
         //    1 - EMA
         //    2 - SMMA
         //    3 - LWMA
   extern int MAMode=1;

//
//
//
//
//

double SK[];
double SD[];
double StoRSI[];
double RSI[];

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(4);
      SetIndexBuffer(0,SK);
      SetIndexBuffer(1,SD);
      SetIndexBuffer(2,StoRSI);
      SetIndexBuffer(3,RSI);
   IndicatorShortName("DTOSC ("+PeriodRSI+","+PeriodStoch+","+PeriodSK+","+PeriodSD+")");
return(0);
}
int deinit() { return(0); }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
{
   int i,limit;
   int counted_bars = IndicatorCounted();

   if(counted_bars < 0) return(-1);
   if(counted_bars > 0) counted_bars--;
             limit=Bars-counted_bars;

   //
   //
   //
   //
   //
            
   for(i=limit; i>=0; i--)
   {
      RSI[i] = iRSI(NULL,0,PeriodRSI,PRICE_WEIGHTED,i);
      double LLV = RSI[ArrayMinimum(RSI,PeriodStoch,i)];
      double HHV = RSI[ArrayMaximum(RSI,PeriodStoch,i)];
      if ((HHV-LLV)!=0)
            StoRSI[i] = 100.0*((RSI[i] - LLV)/(HHV - LLV));
      else  StoRSI[i] = 0;
   }   
   for(i=limit; i>=0; i--) SK[i]=iMAOnArray(StoRSI,0,PeriodSK,0,MAMode,i);
   for(i=limit; i>=0; i--) SD[i]=iMAOnArray(    SK,0,PeriodSD,0,MAMode,i);
   return(0);
}
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-18 09:18 PM | 显示全部楼层
出啥事了? 谁又惹着俺们老大了?谢老大无私奉献.
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-18 09:37 PM | 显示全部楼层
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-18 10:04 PM | 显示全部楼层
Thanks.
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-18 11:18 PM | 显示全部楼层
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-19 12:56 AM | 显示全部楼层
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-19 10:16 PM | 显示全部楼层
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-20 05:35 AM | 显示全部楼层
Thanks.

回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-20 09:38 AM | 显示全部楼层
Thanks!!!
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-8-20 07:55 PM | 显示全部楼层
期盼中。。
回复 鲜花 鸡蛋

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2025-8-8 05:12 AM , Processed in 0.068018 second(s), 14 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表