Using the ADX as a Chart Label
home | Think or Swim Tutorials | Using the ADX as a Chart Label

Using the ADX as a Chart Label

Henry Gambell

# beginning of code ---------------------- - # current ADX as a label at top of the chart # # Label color changes according to value of ADX: # . Green if >25 # . Gray if 20 to 25 # . Red if < 20 #

input length = 14;

plot currentADX = ADX(length);

currentADX.hide();

DefineGlobalColor("ADXHigh", CreateColor(50, 205, 50)); DefineGlobalColor("ADXLow", Color.RED); DefineGlobalColor("ADXMid", Color.GRAY);

AddLabel (yes, (Concat("ADX = ", Round(currentADX,1))),if currentADX > 25 then GlobalColor("ADXHigh") else if currentADX < 20 then GlobalColor("ADXLow") else GlobalColor("ADXMid"));

# end of code -------------------------------