Catalysis of the reaction: (R)-3-hydroxyicosanoyl-CoA(4-) + NADP(3-) <=> 3-oxoicosanoyl-CoA + NADPH + H+.