If you're simply trading with your own money and have not incorporated, then you are not eligible for a solo 401(k). Nerdwallet has an excellent Q&A on the topic here for example. Solo 401(k) is only allowed to be funded with earned income, and capital gains are not earned income.
From the IRS page on One Participant 401(k) plans:
Elective deferrals up to 100% of compensation (“earned income” in the case of a self-employed individual) up to the annual contribution limit
Earned income is defined by the IRS here:
- Wages, salaries, tips, and other taxable employee pay;
- Union strike benefits;
- Long-term disability benefits received prior to minimum retirement age;
- Net earnings from self-employment if (...)
But not including:
- Pay received for work while an inmate in a penal institution
- Interest and dividends
- Retirement income
- Social security
- Unemployment benefits
- Child support.
Even more clearly, that page notes:
There are two ways to get earned income:
You work for someone who pays you
You own or run a business or farm
Capital gains are certainly neither of these.
Now, I have read several articles suggesting one way to go about using the Solo 401k. All of them suggest that you would need to incorporate in some fashion that would require a Schedule C tax return, though, and be trading with the company's money rather than your own, and then pay yourself a wage from that. In that case you would be eligible for a Solo 401(k), and you might even be better off as a result of all that maneuvering (even though you'll be taxed at a higher rate for any income you do keep, likely, and have to pay self-employment tax).