first the data here should be of a boolean data type int trade_opened = false; // To check that there are no open trades. Some times the code compiles but the code might no work as intended