Is it possible to cancel a manual order in OnTradeTransaction before it is executed?

 

Hello,
Is it possible to cancel a manual order in OnTradeTransaction handler before it is executed?

If I put a market order manually, I wan to make sure its volume not to exceeds a specific amount based on account balance. Therefore, I want to change its volume before it is executed or cancel it and re-send another order with the correct volume.

I assume that I can do this in OnTradeTransaction handler? 
Question 1: How can I check event is triggered for a new market order, not modifying or closing, need to detect a new market order only.
Quesiton 2: How can I cancel transaction before it is executed?

Thanks!

 
hayır gidemezsin