In most cases you can see the reason of problems from the error message by the broker. "Insufficient margin" means that you have not enough money for buying 4004 lots. Depending on your leverage and lot size, you would need a five-digit figure on your account for that. "No permit to login" means that you entered a wrong account number or API token.