I'm a trainer and it's a bit complicated for me to convert this thinkscript code to easy language.
Can anyone please help me? Many thanks
declare upper;
input avglength = 14;
input MTaverageType = AverageType.WILDERS;
input ATRLength = 5;
input MTprice = hlc3;
input MTreversalMode = {default ATRpercent, price};
input MTreversalAmount = .5;
##DayATR Value Calculation
def highPrice = FundamentalType.high;
def closePrice = FundamentalType.close;
def lowPrice = FundamentalType.low;
def aggregationPeriod = AggregationPeriod.DAY;
rec AvgTrueRange = MovingAverage(AverageType.SIMPLE, TrueRange(Fundamental (highPrice, period = AggregationPeriod.Day), Fundamental (closePrice, period = AggregationPeriod.DAY), Fundamental (lowPrice, period = AggregationPeriod.DAY) ),ATRlength);
##############
##
ATR percent conversion calculation
rec DayATRReversalValue = MTreversalAmount*(AvgTrueRange/close)*100;
def mode = if MTreversalMode == MTreversalMode.price then ZigZagTrendSign(price = MTprice, reversalAmount=MTreversalAmount) else ZigZagTrendPercent(price = MTprice, reversalAmount=DayATRReversalValue);
def MTinflection = if MTreversalMode == MTreversalMode.price then if !isNan(ZigZagSign(price = MTprice, reversalAmount=MTreversalAmount)) then 1 else 0 else if !isNan(ZigZagPercent(price = MTprice, reversalAmount=DayATRReversalValue)) then 1 else 0;
rec MTtrend = if MTinflection==1 and mode ==-1 then 1 else if MTinflection==1 and mode==1 then -1 else MTtrend[1];
rec MTupWaveVolume = if MTinflection==1 and MTtrend==1 and close>open then volume else if MTinflection==1 and MTtrend==1 and close <= open then 0 else if MTtrend==1 or (MTinflection==1 and MTtrend ==-1 and close>=open) then MTupWaveVolume[1]+volume else 0;
rec MTdownWaveVolume = if MTinflection==1 and MTtrend ==-1 and close<open then volume else if MTinflection==1 and MTtrend ==-1 and close>=open then 0 else if MTtrend==-1 or (MTinflection==1 and MTtrend==1 and close <= open) then MTdownWaveVolume[1]+volume else 0;
plot BuySignal = MTinflection[1] and MTdownwavevolume[2] > 0;
BuySignal.SetDefaultColor(Color.Cyan);
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.SetLineWeight(4);
plot SellSignal = MTinflection[1] and MTupwavevolume[2] > 0;
SellSignal.SetDefaultColor(Color.Magenta);
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SellSignal.SetLineWeight(4);
####################
##volume label add-on
##input MTVolumeAudible_Alert = yes;
def MTVolumeDeviation_Length = 60;
def MTVolumeDeviate = 2;
def MTvolumestdevlength = RelativeVolumeStDev(length = MTvolumeDeviation_Length);
def abovedev = MTvolumestdevlength >= MTvolumeDeviate;
def belowdev = MTvolumestdevlength <= MTvolumeDeviate;
def MTvolumeincrease = volume > volume[1];
def MTvolumedevincrease = MTvolumeincrease and abovedev;
def MTvolumedecrease = volume < volume[1];
def MTvolumedevdecrease = MTvolumedecrease and abovedev;
def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def MTvolumeBuying = V * (C - L) / (H - L);
def MTvolumeSelling = V * (H - C) / (H - L);
input Show_Labels = yes;
AddLabel(Show_Labels, "Buy
Vol = " + Round(MTvolumeBuying, 0), if MTvolumeBuying > MTvolumeSelling then color.green else color.red);
AddLabel(Show_Labels, "Sell Vol = " + Round(MTvolumeSelling, 0), if MTvolumeSelling > MTvolumeBuying then color.green else color.red);