Inputs:tf1Mult(2),tf2Mult(3),tf3Mult(4),tf4Mult(5);
vars: mtf1h(0),mtf1l(0),mtf1o(0),mtf1c(0),mtf1pvt(0),diff1(0),
mtf2h(0),mtf2l(0),mtf2o(0),mtf2c(0),mtf2pvt(0),diff2(0),
mtf3h(0),mtf3l(0),mtf3o(0),mtf3c(0),mtf3pvt(0),diff3(0),
mtf4h(0),mtf4l(0),mtf4o(0),mtf4c(0),mtf4pvt(0),diff4(0),
mtf0pvt(0),diff0(0);
If barNumber > 1 then
Begin
mtf0pvt = (close + high + low) / 3;
diff0 = close - mtf0pvt;
mtf1h = highest(h,tf1Mult);
mtf1l = lowest(l,tf1Mult);
mtf1c = close;
mtf1pvt = (mtf1h+mtf1l+mtf1c) / 3;
diff1 = mtf1c - mtf1pvt;
mtf2h = highest(h,tf2Mult);
mtf2l = lowest(l,tf2Mult);
mtf2c = close;
mtf2pvt = (mtf2h+mtf2l+mtf2c) / 3;
diff2 = mtf2c - mtf2pvt;
mtf3h = highest(h,tf3Mult);
mtf3l = lowest(l,tf3Mult);
mtf3c = close;
mtf3pvt = (mtf3h+mtf3l+mtf3c) / 3;
diff3 = mtf3c - mtf3pvt;
mtf4h = highest(h,tf4Mult);
mtf4l = lowest(l,tf4Mult);
mtf4c = close;
mtf4pvt = (mtf4h+mtf4l+mtf4c) / 3;
diff4 = mtf4c - mtf4pvt;
Condition10 = diff0 > 0;
Condition11 = diff1 > 0;
Condition12 = diff2 > 0;
Condition13 = diff3 > 0;
Condition14 = diff4 > 0;
If condition10 then setPlotColor(1,Green) else SetPlotColor(1,Red);
If condition11 then setPlotColor(2,Green) else SetPlotColor(2,Red);
If condition12 then setPlotColor(3,Green) else SetPlotColor(3,Red);
If condition13 then setPlotColor(4,Green) else SetPlotColor(4,Red);
If condition14 then setPlotColor(5,Green) else SetPlotColor(5,Red);
condition6 = condition10 and condition11 and condition12 and condition13 and condition14;
Condition7 = not(condition10) and not(condition11) and not(condition12) and not(condition13) and not(condition14);
If condition6 then setPlotColor(7,Green);
If condition7 then setPlotColor(7,Red);
If condition6 or condition7 then plot7(7,"trend");
Plot6(5,"line");
Plot1(4,"t1");
Plot2(3,"t2");
Plot3(2,"t3");
Plot4(1,"t4");
Plot5(0,"t5");
end;