Help with indicator - Lowest of MA

Here is TOS code and I am trying to convert it to Tradovate

plot average = Average(close, 14);
def minAverage = Lowest(average, Max(18, 1));
def maxAverage = Highest(average, Max(18, 1));
plot levelUp = minAverage + (maxAverage - minAverage) * 90/ 100.0;
plot levelDown = minAverage + (maxAverage - minAverage) * 10/ 100.0;

How do I get the min and max and plot 2 lines

Thanks!!

@Alexander Can you please help?? I saw your other thread about the highs and wanted to see if you could possibly help.