赤字 and 黒字 seem to correspond directly to the English expressions 'red ink' and 'black ink', meaning a (financial) deficit/loss and surplus, respectively. If Wiktionary is to be trusted, Mandarin, Cantonese and Korean use 赤字 in the same way. Furthermore, French has the expression être dans le rouge ('to be in the red').
Etymonline lists the first recorded instance of 'red ink' in English as being from 1929, and 語源由来辞典 asserts that 赤字 and 黒字 spread in Japanese during the 大正時代 (1912-1926) to the start of 昭和時代 (1926-1989).
How did 赤字 and 黒字 come to be used in Japanese? Are the terms borrowed from a European language (or vice versa), or did the practice of using red ink for losses and black ink for profits arise independently?