How the pokemon’s gender is determined for a thestery gift code

pokemon-sixth-generationpokemon-x-y

I had a mystery gift code for a shiny Gengar in Pokemon X/Y that I used today.

I want a male Gengar, but after ~ 50 resets, I only had females ones. The nature and stats change every time, but the gender looks preset somehow.

Do you know which factors determine the gender for a mystery gift code?

Best Answer

The gender is set when you receive the wonder card, whereas the nature and IVs are set when you receive the Pokemon from the npc.
You can't soft-reset for gender, but you can for nature and IVs.

P.S sometimes the gender is pre-set, so there's no way to get a different gender at all.