In your Paragraph Styles go in its definition into the section Justification.
Never work without Paragraph Styles.
I want to automate the H&J values depends upon the font, font size and text width in the InDesign document instead of using manual H*J values.
Is it possible to generate the H&J values by sizes and text width?
You have to specify it in your paragraph styles. That is the way how it works. Use only OTF.
Good fonts include a professional Hinting.
If not, use optical kerning.
They way Quark Xpress has done it, is not available in InDesign. But InDesign’s typgraphic capabilities are superior to those of Quark.
My favorite starting points:
Optical kerning method, along with H&Js:
all three switches off
Word 80 | 100 | 120
Letter -5 | 0 | 5
Glyph 95 | 100 | 105