Hi!
This indicator detects excess market moves. It is stated, that it “overcomes many of the downsides of traditional ones like RSI or Bollinger Bands”.
The magic: it only shows bullish or bearish excess trends for a chosen timeframe. No detection, no line.
How to use it:
“If the indicator tells me that there has been an excess bearish move, I will not set up a new short position. I neither would set up a long position if this sell off happened in a bearish market.
If there has been an excess bearish move in an uptrend, I might want to start to scale into a long position, using a tight stop loss at the beginning and the let it run until my indicator flashes a warning sign in the other direction.”
All the info:
https://www.quanttrader.com/index.php/detecting-excess-market-moves/KahlerPhilipp2021
Is it possible to translate this code? Many thanks!
Meta: subchart(false); // (c) Philipp Kahler 2021 quanttrader.com
Inputs: minBars(5), maxBars(200), reversaltype(longreversal, shortreversal, both),confirmationbars(1), Volaexcess(3);
Arrays: Mom[maxbars];
Variables: kv, kvp, i, m, signal, global::signal, extreme, position;
function kvol begin // returns Kahlers Volatility %/bar
Variables:i, rp,rc, rpsum, rcsum, call, put, counter;
if close[1]<>0 then begin
rc=maxlist((close-close[1])/close[1],0);
rp=maxlist((close[1]-close)/close[1],0);
end;
rcsum=rcsum+rc;
rpsum=rpsum+rp;
if (rc+rp)>0 then counter=counter+1;
if counter>1 then begin
call=rcsum/counter;
put=rpsum/counter;
end;
Kvol=100*(call+put);
end;
kv=kvol;//period(10*maxbars);
signal=0;
if barnumber>200 then begin
for i=maxBars to MinBars step -1 begin
kvp=kv*sqrt(i);
m=100*(close-close[i])/close;
mom[i]=abs(m)/kvp;
end;
end;
extremesarray(mom,maxbars,1,extreme,position);
if extreme>volaexcess and position>minbars then begin
if close[position]>close and (reversaltype=both or reversaltype=shortreversal)
and lowest(close[-confirmationbars],confirmationbars)>=close
and close=lowest(close,position)
and close[position]=highest(close,position+1)
then begin
drawtrendline(datetime,lowest(close,position),datetime[position],highest(close,position+1),stylesolid,2,red);
signal=1;
end;
if close[position]<close and (reversaltype=both or reversaltype=longreversal)
and highest(close[-confirmationbars],confirmationbars)<=close
and close=highest(close,position+1)
and close[position]=lowest(close,position+1)
then begin
drawtrendline(datetime,highest(close,position),datetime[position],lowest(close,position+1),stylesolid,2,darkgreen);
signal=-1;
end;
end;
global::signal=signal[confirmationbars];