Step One More Average
Forums › ProRealTime forum Français › Support ProBuilder › Step One More Average
- This topic has 2 replies, 1 voice, and was last updated 8 years ago by supertiti.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
12/12/2016 at 8:13 PM #1839412/12/2016 at 8:17 PM #18399
Bon j’ai essayé d’exporter le fichier .itf mais c’est loupé !
le voici en clair
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485// OMA PRC step one more average 12.12.2016//Nicolas @ www.prorealcode.com Sharing ProRealTime knowledge//converted and adapted from MT4 versionLength = Max(Length,1)Speed = Max(Speed,-1.5)price = average[1](customclose)//adaptive periodaveragePeriod = Lengthif adaptive=1 and averagePeriod > 1 thenminPeriod = averagePeriod/2.0maxPeriod = minPeriod*5.0endPeriod = round(maxPeriod)signal = Abs((price-stored[endPeriod]))noise = 0.00000000001for k=1 to endPeriod donoise=noise+Abs(price-stored[k])averagePeriod = round(((signal/noise)*(maxPeriod-minPeriod))+minPeriod)nextendiftconst=Speedalpha = (2.0+tconst)/(1.0+tconst+averagePeriod)e1 = e1 + alpha*(price-e1)e2 = e2 + alpha*(e1-e2)v1 = 1.5 * e1 - 0.5 * e2e3 = e3 + alpha*(v1 -e3)e4 = e4 + alpha*(e3-e4)v2 = 1.5 * e3 - 0.5 * e4e5 = e5 + alpha*(v2 -e5)e6 = e6 + alpha*(e5-e6)v3 = 1.5 * e5 - 0.5 * e6stored=price//step function//iStepMa(Sensitivity,iATR(NULL,0,StepSize,i),1.0,thigh,tlow,Close[i],i);Sensitivity = max(Sensitivity,1*pointsize)ATRStepSize=averagetruerange[StepSize]Step = max(ATRStepSize,1*pointsize)size = sensitivity*Stepphigh = v3plow = v3[7]stepMulti = 1.0workStepsmax = phigh+2.0*size*stepMultiworkStepsmin = plow-2.0*size*stepMultiworkSteptrend = workSteptrend[1]pprice = customcloseif (pprice>workStepsmax[1]) thenworkSteptrend = 1endifif (pprice<workStepsmin[1]) thenworkSteptrend = -1endifif (workSteptrend = 1) thenif (workStepsmin < workStepsmin[1]) thenworkStepsmin=workStepsmin[1]endifresult = workStepsmin+size*stepMulticolor = 1endifif (workSteptrend = -1) thenif (workStepsmax > workStepsmax[1]) thenworkStepsmax=workStepsmax[1]endifresult = workStepsmax-size*stepMulticolor = -1endifcc = customcloseOMAH = result + coeffOMAB = result - coeffRETURN cc as " cc " ,result coloured by color as "OMA step" , OMAH as " OMAH " , OMAB as " OMAB "// Variables ://Length = 25 entier//Speed = 3.0 decimal//Adaptive = true; boléen//Sensitivity = 0.5 decimal // Sensivity Factor//StepSize = 50 decimal // Step Size period//coeff = 1 decimal//Indicator built upon a special moving average formula that adapt its period automatically accordingly to the market behaviour and noises. This moving average is called the OMA (One More Average), the formula come from an MT4 version found on internet.//Converted from MT4 because of a request on forum.//This version of the one more average indicator embed a step variation of the result of the calculation. The sensitivity and step size can be modified in order to adapt how the moving average respond to the step function, which is comparing how the moving average evolved between difference of actual and past data with current average true range.//The adaptive period can be more or less adaptive by changing the "speed" parameter (0.1 step). The adaptive behaviour of the formula can be shutdown with "Adaptive=0".12/13/2016 at 11:02 AM #18434 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: