You can set a search parameter where you search for allies in a set price range, but you can't set an ally to be a certain price. You buy it for what it is worth, and if someone else buys it, you can either take your gold + profit and buy a different one, or try to buy the one you bought again if you have enough gold.
A tactic I’ve seen a lot though is just to bounce the price of an ally up with a partner (usually a clan mate or an alt) until you think the price is what they want (basically you can increase the price). It should be noted, however, that the ally can still be hired away by others.
Yeah, we volley allies a lot if we need the gold or need an ally to get to a certain price range so it gets less likely to be bought again.