世人都曉神仙好,只有功名忘不了! 古今將相在何方?荒塚一堆草沒了! 世人都曉神仙好,只有金銀忘不了! 終朝只恨聚無多,及到多時眼閉了! 世人都曉神仙好,只有姣妻忘不了! 君生日日說恩情,君死又隨人去了! 世人都曉神仙好,只有兒孫忘不了! 痴心父母古來多,孝順兒孫誰見了?
2010年9月9日 星期四
自製指標 :EMA Slope Long
自製指標 :EMA Slope Long
用當天的 EMA 來減去前一天的 EMA
用來看某一條 EMA 的斜率
有趣的是 這個算法和 Pips_To_EMA 的圖表看起來差不多是完全一樣哦
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//+------------------------------------------------------------------+
//| Bulls.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 Silver
//---- input parameters
extern int BullsPeriod=250;
//---- buffers
double BullsBuffer[];
double TempBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 1 additional buffer used for counting.
IndicatorBuffers(2);
IndicatorDigits(Digits);
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,BullsBuffer);
SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label
short_name="EMA_Slope_Long("+BullsPeriod+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
return(0);
}
//+------------------------------------------------------------------+
//| Bulls Power |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
if(Bars<=BullsPeriod) return(0);
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;
for(i=0; i<limit; i++)
TempBuffer[i]=iMA(NULL,0,BullsPeriod,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,BullsPeriod,0,MODE_EMA,PRICE_CLOSE,i+1);
i=Bars-counted_bars-1;
while(i>=0)
{
BullsBuffer[i]=TempBuffer[i];
i--;
}
return(0);
}
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言