Green’s Dictionary of Slang

billy n.3

[? King William IV, in whose reign (1830–37) the practice began. The silk handkerchief was a central part of costermonger fashion, often aping that of the prize-ring, where fancy handkerchiefs were an essential trademark of certain fighters. As Mayhew notes, in London Labour and the London Poor (1861–62): ‘The costermonger [...] prides himself most of all upon his neckerchief and boots. Men, women, boys and girls all have a passion for these articles. The man who does not wear his silk neckerchief – his “King’s-man” as it is called – is known to be in desperate circumstances, the implication being that it has gone to supply the morning’s stock money’]

a silk handkerchief, worn by London costermongers.

[UK]W.A. Miles Poverty, Mendicity and Crime; Report 115: The new term for handkerchiefs is a Billy, for which pickpockets have peculiar terms known only in the trade.
[UK]J. Archbold Magistrate’s Assistant (3rd edn) 444: A silk handkerchief. A billy.
[UK]Hotten Dict. of Modern Sl. etc.
[UK]Hotten Sl. Dict.
[UK]Dundee Courier 4 July 7/4: His headgear — he had a soft ‘billy’ tied round his head.

In compounds