All things being equal 18'-22' is the optimum height. Unfortunately,
this isn't always the case. Factors to consider, as mentioned, cover provided, where do you expect the deer to come from, time of year
( you will need to hunt higher during late season after 'leaf drop'),
and where are your shooting lanes/possible shots.
I rarely hunt below 14'-15' or above 23'-24'. On the low-end odds are you'll get busted by either movement or getting winded, on the high-end the shot angle gets much too steep.
Don't forget "background cover" in the placement of your stand height. In my early days
I had several great bucks 'bust' me while trying to get to full draw because I was 'skylined'
from no background cover.
Now, if there's insufficient cover I duct tape artificial limbs/leaves to my stand and the
limbs around my stand. It really helps with blocking out your outline.
Here is a "before & after" pic. The 1st is from this spring when I prepped this tree (without the artificial limbs). This is a honey locust, which drop their leaves early.
Here is a pic from this fall, also the tree I took my buck from

.
Good Luck