Excellent results. Do you use TMO to agree with entries for the backtesting? Small we also integrate TMO as a fifth parameter?
Yes, when back testing this I noticed that it is better to take long entries only when TMO is below 0 and go short when TMO is above 0. I did not wait for TMO to reach over bought/oversold territories as many times it did not reach those levels however, the trend reversed, and you would have missed a big move. My settings for TMO were 30,6,6. Try this out and let me know what you think. Using the TMO will give you less false signals so adding this into the indicator would be great. I haven't seen that being done in other scripts so not sure if it would work. I added clouds to help me visualize the levels below and above 0 better.
# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
# hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
declare lower;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
def o = open;
def c = close;
def data = fold i = 0 to length
with s
do s + (if c > GetValue(o, i)
then 1
else if c < GetValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.HideBubble();
Signal.HideTitle();
AddCloud(Main, Signal, Color.GREEN, Color.RED);
plot zero = if IsNaN(c) then Double.NaN else 0;
zero.SetDefaultColor(Color.GRAY);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNaN(c) then Double.NaN else Round(length * .7);
ob.SetDefaultColor(Color.GRAY);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNaN(c) then Double.NaN else -Round(length * .7);
os.SetDefaultColor(Color.GRAY);
os.HideBubble();
os.HideTitle();
AddCloud(0, length, Color.LIGHT_RED, Color.LIGHT_RED, no);
AddCloud(ob, length, Color.GRAY, Color.GRAY, no);
AddCloud(0, -length, Color.LIGHT_GREEN, Color.LIGHT_GREEN);
AddCloud(os, -length, Color.GRAY, Color.GRAY);
# End Code TMO