变色均线指标代码求指教
请大神指教: 变色均线指标红色部分这样计算的含义int start() { Draw4HowLong = Bars-Rperiod - 5; //Rperiod = 20 length = Rperiod; //length now = 20 lsma_length = LSMA_Period; loopbegin = Draw4HowLong - length - 1; for(shift = loopbegin; shift >= 0; shift--) // MAIN For Loop { sum[1] = 0; for(i = length; i >= 1 ; i--) //LSMA loop { lengthvar = length + 1; //lengthvar = 21 lengthvar /= 3; //lengthvar = 7 tmp = 0; tmp = ( i - lengthvar)*Close[length-i+shift]; //tmp = 20 - 7 * close[20-i+shift] sum[1]+=tmp; } wt[shift] = sum[1]*6/(length*(length+1)); j = shift; lsma_ma[shift] = wt[j+1] + (wt[j]-wt[j+1])* 2/(lsma_length+1); //========== COLOR CODING =========================================== ExtMapBuffer1[shift] = wt[shift]; ExtMapBuffer2[shift] = lsma_ma[shift]; ExtMapBuffer3[shift] = wt[shift]; ExtMapBuffer4[shift] = lsma_ma[shift]; if (wt[shift] < lsma_ma[shift]) { ExtMapBuffer4[shift] = EMPTY_VALUE; ExtMapBuffer3[shift] = EMPTY_VALUE; } } } |
打赏
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1