Hi,

I have attempted to write an AFL to sum all the digits in a candle’s High.

I have beaten about the bush.Is there any better way or Syntax?

I have given the code what i have attempted so far.

This Code is meant for 4 Digit INTEGER price.

I am looking for alternate method which can solve any digit along with fraction,

```
inth1a=int(Ref(H,0)/1000);//first digit
inth2=frac(Ref(H,0)/1000)*10;//first split for second digit
inth2a=int(inth2);//second split for second digit
inth3=frac(Ref(H,0)/100)*10;//first split for third digit
inth3a=int(inth3);//secondsplit for third digit
inth4=round(Ref(H,0));//Rounding the high value
inth41=frac(Ref(inth4,0)/10);//first split for Fourth Digit
inth4a=round(inth41*10);//Second split for fourth digit
Sumhighs=inth1a+inth2a+inth3a+inth4a;//first addition of all the digits.
Highs1=IIf(Sumhighs<10,Sumhighs,int((Sumhighs)/10)+frac((Sumhighs)/10)*10);
Highs2=IIf(sumHighs<10,sumhighs,IIf(Highs1<10,Highs1,int(Highs1)/10+frac(Highs1)/10)*10);
Highs3=IIf(Highs2<10,Highs2,int(Highs2)/10+frac(Highs2)/10);
Highs4=IIf(Highs3<10,Highs3,int(Highs3)+frac(Highs3));
```

Any help would be appreciated.

Thanks,

Gloria Filamino,