Dual Status

My status changed from NRA to RA in June last year (under the substantial presence test), and I was RA on the last day of the year. During this whole time, I am under F-1 visa. 

 

The only source of income during my NRA time was my W-2 wages. After I became RA, I had stock gains from trades ect. 

 

When I file, should I file all my W-2 on 1040? If not, how should I split the income to 1040-NR? Or I just need to include my W-2 together with my 1040 to have w-2 as my source of income for NRA time (no 1040 nr needed)?