[房贷计算方法]MT4中分形源码
作者
//+------------------------------------------------------------------+
//|? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???Fractals.mq4 |
//|? ?? ?? ?? ?? ?? ?? ? Copyright ?2005, MetaQuotes Software Corp. |
//|? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? .metaquotes.net |
//+------------------------------------------------------------------+
property copyright "Copyright ?2005, MetaQuotes Software Corp."
property link? ?? ?".metaquotes.net"
property indicator_chart_window
property indicator_buffers 2
property indicator_color1 Red
property indicator_color2 Blue
//---- input parameters
//---- buffers
double ExtUpFractalsBuffer[];
double ExtDownFractalsBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function? ?? ?? ?? ?? ?? ?? ?? ? |
//+------------------------------------------------------------------+
int init()//初始化函数
??{
//---- indicator buffers mapping??
? ? SetIndexBuffer(0,ExtUpFractalsBuffer);
? ? SetIndexBuffer(1,ExtDownFractalsBuffer);? ?
//---- drawing settings
? ? SetIndexStyle(0,DRAW_ARROW);
? ? SetIndexArrow(0,119);
? ? SetIndexStyle(1,DRAW_ARROW);
? ? SetIndexArrow(1,119);
//----
? ? SetIndexEmptyValue(0,0.0);
? ? SetIndexEmptyValue(1,0.0);
//---- name for DataWindow
? ? SetIndexLabel(0,"Fractal Up");
? ? SetIndexLabel(1,"Fractal Down");
//---- initialization done? ?
? ?return(0);
??}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function? ?? ?? ?? ?? ?? ?? ???|
//+------------------------------------------------------------------+
int deinit()//init的析构函数
??{
//---- TODO: add your code here
? ?
//----
? ?return(0);
??}
//+------------------------------------------------------------------+
//| Custom indicator iteration function? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?|
//+------------------------------------------------------------------+
int start()//主函数
??{
? ?int? ? i,nCountedBars;
? ?bool? ?bFound;
? ?double dCurrent;
? ?nCountedBars=IndicatorCounted();//核算的是目标加载到图上后现已核算过的K线个数
//----
? ?
? ?if(nCountedBars2)
? ???{
? ?? ?nCountedBars--;
? ?? ?i=Bars-nCountedBars-1;
? ???}
//----Up and Down Fractals
? ?while(i>=2)
? ???{
? ?? ?//----Fractals up
? ?? ?bFound=false;
? ?? ?dCurrent=High;
? ?? ?if(dCurrent>High[i+1] && dCurrent>High[i+2] && dCurrent>High[i-1] && dCurrent>High[i-2])
? ?? ???{
? ?? ?? ?bFound=true;
? ?? ?? ?ExtUpFractalsBuffer=dCurrent;
? ?? ???}
? ?? ?//----6 bars Fractal
? ?? ?if(!bFound && (Bars-i-1)>=3)
? ?? ???{
? ?? ?? ?if(dCurrent==High[i+1] && dCurrent>High[i+2] && dCurrent>High[i+3] &&
? ?? ?? ?? ?dCurrent>High[i-1] && dCurrent>High[i-2])
? ?? ?? ???{
? ?? ?? ?? ?bFound=true;
? ?? ?? ?? ?ExtUpFractalsBuffer=dCurrent;
? ?? ?? ???}
? ?? ???}? ?? ?? ?
? ?? ?//----7 bars Fractal
? ?? ?if(!bFound && (Bars-i-1)>=4)
? ?? ???{? ?
? ?? ?? ?if(dCurrent>=High[i+1] && dCurrent==High[i+2] && dCurrent>High[i+3] && dCurrent>High[i+4] &&
? ?? ?? ?? ?dCurrent>High[i-1] && dCurrent>High[i-2])
? ?? ?? ???{
? ?? ?? ?? ?bFound=true;
? ?? ?? ?? ?ExtUpFractalsBuffer=dCurrent;
? ?? ?? ???}
? ?? ???}??
? ?? ?//----8 bars Fractal? ?? ?? ?? ?? ?? ?? ?? ???
? ?? ?if(!bFound && (Bars-i-1)>=5)
? ?? ???{? ?
? ?? ?? ?if(dCurrent>=High[i+1] && dCurrent==High[i+2] && dCurrent==High[i+3] && dCurrent>High[i+4] && dCurrent>High[i+5] &&
? ?? ?? ?? ?dCurrent>High[i-1] && dCurrent>High[i-2])
? ?? ?? ???{
? ?? ?? ?? ?bFound=true;
? ?? ?? ?? ?ExtUpFractalsBuffer=dCurrent;
? ?? ?? ???}
? ?? ???}
? ?? ?//----9 bars Fractal? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ?if(!bFound && (Bars-i-1)>=6)
? ?? ???{? ?
? ?? ?? ?if(dCurrent>=High[i+1] && dCurrent==High[i+2] && dCurrent>=High[i+3] && dCurrent==High[i+4] && dCurrent>High[i+5] &&
? ?? ?? ?? ?dCurrent>High[i+6] && dCurrent>High[i-1] && dCurrent>High[i-2])
? ?? ?? ???{
? ?? ?? ?? ?bFound=true;
? ?? ?? ?? ?ExtUpFractalsBuffer=dCurrent;
? ?? ?? ???}
? ?? ???}? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ?//----Fractals down
? ?? ?bFound=false;
? ?? ?dCurrent=Low;
? ?? ?if(dCurrent=dCurrent;
? ?? ???}
? ?? ?//----6 bars Fractal
? ?? ?if(!bFound && (Bars-i-1)>=3)
? ?? ???{
? ?? ?? ?if(dCurrent==Low[i+1] && dCurrent=dCurrent;
? ?? ?? ???}? ?? ?? ?? ?? ?? ?? ?
? ?? ???}? ?? ?? ?
? ?? ?//----7 bars Fractal
? ?? ?if(!bFound && (Bars-i-1)>=4)
? ?? ???{? ?
? ?? ?? ?if(dCurrent=dCurrent;
? ?? ?? ???}? ?? ?? ?? ?? ?? ?? ?
? ?? ???}??
? ?? ?//----8 bars Fractal? ?? ?? ?? ?? ?? ?? ?? ???
? ?? ?if(!bFound && (Bars-i-1)>=5)
? ?? ???{? ?
? ?? ?? ?if(dCurrent=dCurrent;
? ?? ?? ???}? ?? ?? ?? ?? ?? ?? ?
? ?? ???}
? ?? ?//----9 bars Fractal? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ?if(!bFound && (Bars-i-1)>=6)
? ?? ???{? ?
? ?? ?? ?if(dCurrent=dCurrent;
? ?? ?? ???}? ?? ?? ?? ?? ?? ?? ?
? ?? ???}? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ?i--;
? ???}
//----
? ?return(0);
??}
//+------------------------------------------------------------------+
买卖技能, 买卖战略, 源码, MT4
买卖技能, 买卖战略, 源码, MT4
目录
推荐阅读
-
卓尔集团股票广宇集团股吧为什么下跌,股价下跌原因
我的个股600031DR(表明除权除息)了,为何股票价格削减了那么多呢我的个股600031DR(表明除权除息)了,为何股票价格削减...
-
葛洲坝在哪里哪马云余额宝事件个省的哪个市(葛洲坝在哪里)
本篇文章是有关葛洲坝在哪里的解说,信任许多朋友对这方面不是特别的了解,所以借着本篇文章的时机,说说葛洲坝在哪里哪个省的哪个市的内容...
-
测绘股份一季报(测科蓝软件绘股份)
今日,为咱们解说有关测绘股份的常识内容,假如你对测绘股份一季报的内容感兴趣的话,能够重视咱们的网站,有疑问的话,能够在下方谈论区留...
-
养老保险缴费基数怎么算的 计算方国新控股式如下
...