//Fill the array
FOR i=0 TO 10
$Array[i] = Close[i]
NEXT
//Sum the array values
Sum = 0
FOR j=0 TO LastSet($Array)
Sum = Sum + $Array[j]
NEXT
//Calculate the average
xAverage = Sum / (LastSet($Array)+1)
RETURN xAverage Coloured(“lightBlue”)
Petite correction sur l’avant dernière ligne, on divise par la période, donc 11 en prenant en compte le 0.
Le LastSet($Array) renvoyant 10, o lui rajoute un +1
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue