# convert this basic formula to afl

#### dejorgees

##### New Member
Can you help me to convert this basic formula to afl?

CPM = volume * close
volmax = highest [52] (CPM)
vol = ((CPM * 100 / volmax) * 4 / 5)
volpmed = ExponentialAverage [52] (vol)
CPM2 = (vol - volpmed)
return CPM2 as "CPM"

Thanks

#### mastermind007

##### Well-Known Member
dejorgees

Here is simple AFL. What does this do? What does CPM stand for?
Code:
``````	CPM = Volume * Close;
volmax = HHV(CPM, 52); // 52 days, not week
vol_ = ((CPM * 100)/volmax) * (4/5); // 52 days, not week
volpmed  =  EMA(vol_, 52);
CPM2 = vol_ - volpmed;
Plot(CPM2, "CPM2", colorBlack, styleLine);
// if you do not want to plot, comment above line and can do
// further calc on CPM2``````
Can you help me to convert this basic formula to afl?

CPM = volume * close
volmax = highest [52] (CPM)
vol = ((CPM * 100 / volmax) * 4 / 5)
volpmed = ExponentialAverage [52] (vol)
CPM2 = (vol - volpmed)
return CPM2 as "CPM"

Thanks

#### dejorgees

##### New Member
Mastermind007 forgive me for my not saying anything, my computer broke down and I could not answer.
this shows the areas where the strong hand accumulates

#### dejorgees

##### New Member
with CPM multiply close and volume to determine the amount of money without considering the number of shares that can change while price goes up or down

#### dejorgees

##### New Member
mastermind007 can you tell me how to show this indicator in histogram form and the levels below cero in a color and the others above in another color?

Many many thanks