I have written A divergence strategy long entries
but somehow it doesn't catch all the setups.
using Renko/regular/kase bars.
my thoughts (with no answer right now) for the problem:
does Renko/kase bar charts work for strategies different from regular charts?
Is coding the problem?
what is the frequency the code runs again and again on each chart/time frame? maybe that's the problem?
the code is below you may try it yourself. the trigger function here is RSI Divergence with index
change each iteration to check if the divergence profile consolidated.
Code: Select all
inputs: Price( Close ), Length( 14 ), OverSold( 30 ) ;
variables: varRSI( 0 ),idx(0) ;
varRSI = RSI( Price, Length ) ;
idx = idx+1;
if varRSI[1] < varRSI and varRSI[1] < varRSI[2] and //current low
varRSI[idx+2] < varRSI[idx+1] and varRSI[idx+2] < varRSI[idx+3] and //first low
varRSI[idx+2] < varRSI[1] and varRSI[idx+2] < overSold and //first low < current low - indicator up
Close[idx+2] > Close[1] and Close > Close[1] then //price decending
buy ("Divergence LE") this bar at Close;
if idx=20 then idx=1; //check up to 20 iterations erlier