You have gotten some good advice already in above posts.

To answer your original question,
the "pure" engineering advice would be to
set the static compression ratio to 14,
which is the static compression ratio that has been found in prior experiments to be the practical maximum for Otto cycle efficiency. Above 14 "negative work" of compressing the air/fuel charge exceeds efficiency improvement.

Note that your expansion ratio is 14,
and the dynamic expansion ratio will be only slightly less than 14.

Now, how do you keep this from detonating?

Keep the air/fuel ratio either richer than 8 or leaner than 20
( detonation is worst near 15 to 1)

Obviously for fuel economy you would go leaner than 20 to 1.

Keep coolant temperature as low as 140 F.
( this low increases bore wall wear rates)

Use sodium filled exhaust valves.

Use irridium tipped sparkplugs, large gaps, and a high energy ignition system.

Use a tri-y exhaust header system to reduce internal exhaust gas recirculation, which can heat up the intake charge.

Use a cam with intake valve closing at least near 65 degrees past bottom center, and maybe as late as 80 degrees.

Mazda has used some of these items in their current SkyActiv engines,
but could not use the very lean air fuel ratios, because they still had to use a three way catalytic converter for NOx.

It is a whole nuther story,
but have you considered building a compressed natural gas engine,
which will give lowest fuel cost per mile,
and methane has a Octane of around 120.