This page describes the general position for an individual resident in the UK. Tax depends on personal circumstances and changes with each budget, and anything that matters should be confirmed with an accountant or with HMRC's published guidance.
The general position
For most individuals, profits from trading CFDs and forex are treated as capital gains, not income. Gains above the annual exempt amount, which has been reduced in recent years and stood at £3,000 at the time of writing, are charged to capital gains tax at the rate in force. Losses can be set against gains in the same year, and unused losses can be carried forward if they are reported to HMRC in time. Gains and losses are calculated in pounds, so trades on a dollar account are converted at the relevant exchange rate.
Spread betting, offered by some brokers as an alternative to CFDs, is treated as gambling and is free of capital gains tax and stamp duty for individuals. That is why it exists in the UK. It is otherwise similar to CFD trading and most MetaTrader accounts are not spread betting accounts.
In rare cases HMRC treats trading as a business, with profits charged to income tax. This applies to very few private individuals and is not something to assume.
Reporting
Capital gains are reported through self-assessment. A return is needed where total gains exceed the exempt amount, or where the total proceeds of disposals exceed a threshold, or where a loss is being claimed. The deadline is the January following the end of the tax year in April.
What to keep
Every broker statement, monthly and annual. The full trade history, exported from the platform at least yearly and after any account change. Records of every deposit and withdrawal, with the exchange rate used. Fees paid for the EA, the VPS and data, which may be relevant to the calculation. Keep everything for at least six years after the tax year it relates to.
A trader with a dollar account makes a net profit of $9,000 over the tax year from 420 trades, with a further $400 in fees and $300 of swap already deducted in the broker's figures. Converted at the rates on the relevant dates, the sterling gain comes to about £7,100. With an exempt amount of £3,000 and no other gains, £4,100 is chargeable. The trader reports it on the self-assessment return, and because the broker's statements and the trade export were kept, the figures can be reconstructed if asked.
An EA produces many trades, and the record keeping is the same as for any other trading, only larger. Export the trade history regularly, keep the broker's statements, and note the account's currency, since the conversion to pounds is often the largest source of error. A verified third-party record of the account is a useful backup but is not a substitute for the broker's own statements, which are what HMRC would expect to see.