relative strength Mansfield's indicator

#1
Lol !

I need any ideas and AFL functions to do the relative strength Mansfield's indicator .
For the instant , I have not understand the syntax of Amibroker formula langage but ...
I have tried to do something ....

At first I need a function to retrieve the value of DJI index or another indice (ex CAC40 french index)

.Most of the time the relative strength mansfield is weekly .The calcultation use a base price of 52 weeks .

Mansfield' indicator formula :

(Market price (t) / S&Pprice (t) ) = R (t)
"Base price"
Base price = BP = ( R (1)+ R (2) +.... + R (t)+....+R (52) ) / 52
graph=PR (t) = (( R (t) / BP) -1 ) x 10

Here is what I have type under the AFL editor ; my syntax is false for the instant

Code:
baseprice= (SUM(CLOSE(t) of the stock x at the screen/CLOSE(t) of DJI or another index,52))/52
mansfield =  ((CLOSE of the stock x / CLOSE of DJI or another index)/ baseprice -1)*10
plot (mansfield)
I nedd to add a horizontal line whose the value = 0 .

Thanks ...
 
#2
Something like this ; I suppose
Code:
baseprice = Sum((Close/Foreign("^DJI","Close")),52)/52;
graphmansfield = ((Close/Foreign("^DJI","Close")/baseprice)-1)*10;
Ligne0 = 0;
Plot(graphmansfield ,"RELATIVE STRENGHT MANSFIELD",colorRed);
Plot(Ligne0,"LINE 0",colorBlue);
If someone who know this indicator can verify that its right ; I am not sure .
 

Similar threads