This can be a highly rocky road and not an area for those feint of heart. You need to spend the upfront time researching this area and a simple google search will address your question.
https://finance.zacks.com/tax-advantages-forex-traders-10457.html
Additionally, you should be able to find this addressed on any major platform that facilitates these transactions.
*A reminder that posts in a forum such as this do not constitute tax advice.
Also keep in mind the date of replies, as tax law changes.