Author: ��������2011��1��9�գ�2011��6��25�����޸�
YangTrader
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
YangTrader
//--  Original Author : yangshu --//
//--  copyright YangShu 2011    --//
//--  Email:yangshu@yangshu.net --//
//--  Web: http://yangshu.net   --//
#property copyright "ÑîÊ÷´´ÓÚ2011Äê1ÔÂ9ÈÕ£¬2011Äê6ÔÂ25ÈÕÔÙÐÞ¸Ä" 
#property link      "http://yangshu.net" 
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1  DeepSkyBlue

#property indicator_level1 15
#property indicator_level2 35
#property indicator_level3 80
#property indicator_levelcolor Gray

#property indicator_minimum 0
#property indicator_maximum 100
extern int TimeWindow=34;
extern int Sensitive=8;
double buf[];
double buf2[];

int init()
  {
   SetIndexBuffer(0,buf);
   ArraySetAsSeries(buf,true);
   SetIndexStyle(0,DRAW_LINE);
   IndicatorShortName("YangTrader (13,21,34,55,89,144) - http://yangshu.net");
   return(0);
  }

int start()
  {
   int limit=Bars;

   ArrayResize(buf2,limit); 
   ArraySetAsSeries(buf2,true);
   for(int i=0; i<limit; i++)
    {
       double HHV=High[iHighest(NULL,0,MODE_HIGH,TimeWindow,i)];
       double LLV=Low[iLowest(NULL,0,MODE_LOW,TimeWindow,i)]; 
       buf2[i]=100*(Close[i]-LLV)/(HHV-LLV);
    }
   ArrayResize(buf,limit); 
   ArraySetAsSeries(buf,true);
   for(i=0; i<limit; i++) buf[i]=iMAOnArray(buf2,limit,Sensitive,0,MODE_LWMA,i);  
   return(0);
  }

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---