I have now incorporated[B] Ken DoubleU’s [/B]modifications into my final slopemeter code. ![:slight_smile: :slight_smile:](https://forums.babypips.com/images/emoji/twitter/slight_smile.png?v=5)
I had to re-insert the zeroline code because the computer would not draw the zeroline at all.
[B]The final code in CTL format for GFT is given below…[/B]
indicator AA_BB_slope_meter ;
input pipdiff = 3;
draw zeroline(“zeroline”, solid_line, black,2),
entry_long(“long”, solid_line, green,2),
entry_short(“short”, solid_line, red,2),
res(“slopemeter”, solid_line, blue,2);
vars i(number),avg(series);
begin
zeroline := makeseries (front(close), back(close), 0);
entry_long := makeseries (front(close), back(close), 0.0001 * pipdiff );
entry_short := makeseries (front(close), back(close), -0.0001 * pipdiff );
avg := sma(close,20);
for i := front(close) + 20 + 1 to back(close) do
res[i] := avg[i] - avg[i-1];
end.
I now invite either [B]IronHeart [/B]or [B]Ken DoubleU[/B] to translate this into MT4 code.
([B]DodgeV83 [/B]or [B]Merchantprince [/B]can also do this if they can and so wish to do - but I am not certain of everyone’s particular skills).