This may work.Hot Dog! That is really interesting! I dropped the plot for the "DIMinussymbol1" and the "ADXsymbol1" and noticed a discernible pattern on a 5 minute chart using a 10 min aggperiod.
Oh..I forgot...I popped a "Label" on this puppy and got an "expected double."
Here is the code again below with the "Label." You will see the syntax at the bottom. I thought that I may have missed a parenthetical mark...but, that doesn't seem to be the case. Any suggestions?
# --- @cos251 - AggPeriod Version of DMI + ADXR
# GLOBAL VARIABLES
declare lower;
input length = 14;
input averageType = AverageType.WILDERS;
input aggPeriod = AggregationPeriod.TWO_MIN;
###### BEGIN ADX Symbol 1
def hiDiffsymbol1 = high(period = aggPeriod) - high(period = aggPeriod)[1];
def loDiffsymbol1 = low(period = aggPeriod)[1] - low(period = aggPeriod);
def plusDMsymbol1 = if hiDiffsymbol1 > loDiffsymbol1 and hiDiffsymbol1 > 0 then hiDiffsymbol1 else 0;
def minusDMsymbol1 = if loDiffsymbol1 > hiDiffsymbol1 and loDiffsymbol1 > 0 then loDiffsymbol1 else 0;
def ATRsymbol1 = MovingAverage(averageType, TrueRange(high( period = aggPeriod), close(period = aggPeriod), low( period = aggPeriod)), length);
plot "DIPlussymbol1" = 100 * MovingAverage(averageType, plusDMsymbol1, length) / ATRsymbol1;
plot "DIMinussymbol1" = 100 * MovingAverage(averageType, minusDMsymbol1, length) / ATRsymbol1;
def DXsymbol1 = if ("DIPlussymbol1" + "DIMinussymbol1" > 0) then 100 * AbsValue("DIPlussymbol1" - "DIMinussymbol1") / ("DIPlussymbol1" + "DIMinussymbol1") else 0;
plot ADXsymbol1 = MovingAverage(averageType, DXsymbol1, length);
plot ADXRsymbol1 = (ADXsymbol1 + ADXsymbol1[length - 1]) / 2;
AddLabel (yes, "ADXPlus", if DIPlussymbol1 > ADXRsymbol1 then Color.RED else Color.GREEN);
############## END ADX Symbol 1
Thanks!
Code:
AddLabel (yes, "ADX: "+ADXsymbol1, if "DIPlussymbol1" > ADXRsymbol1 then Color.RED else Color.GREEN);