Hi,
I saw in a MetaTrader-Forum a Loop for a LSMA and I want to know, how I can create an efs with the "wt"-value?
Perhaps someone has an idea?
Warm Regards
Franz
I saw in a MetaTrader-Forum a Loop for a LSMA and I want to know, how I can create an efs with the "wt"-value?
Code:
Draw4HowLong = Bars-Rperiod - 5; //Rperiod = 20 length = Rperiod; //length now = 20 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)); }
Perhaps someone has an idea?
Warm Regards
Franz
Comment