I wanted to buy tokens with ETH and send directly from my brocker to the token selling company, the transaction failed. is there a way to recover my ETH?
Most token contracts have code which explicitly blocks users from participating in their token sale when sending ETH from an exchange.
In those situations, the transaction should fail, and the Ether should not have moved at all. This is done through the fallback function implemented in the contract.
In order to correctly participate in those kinds of contracts, you will need to have your own wallet, where you are able to send Ether along with a
data parameter which specifies the function you are trying to call, usually the function which exchanges the ether for tokens.
Only at that point can you then transfer the tokens back to your exchange from the wallet you used.