The .mq4 file is the "human-readable" version of a trading robot (Expert Advisor), indicator, or script. Written in MetaQuotes Language 4 (MQL4), it contains the actual logic, variables, and mathematical formulas that dictate how a program reacts to market data.

If you're looking for a more detailed guide or a "solid paper" on converting MQ4 to EX4, I recommend checking out the official MetaTrader documentation:

Assigning a double value to an int variable. Fix: Use explicit casting like int(count) = doubleValue; or change the variable type.