Deductions & credits

Thank you. I am non resident, will that still apply ? Selling stock is not considered connected to U.S trade or business?