Source of income for stocks / forex trading

Hi, Where is the source of income for territorial tax purposes for algorithmic stocks / forex trading? Is it where the stock exchange or currency are based? Where the servers are based? Where the algorithm is managed?
Thank you

1 Like