Can we tell if a compound is explosive by just looking at its chemical structure?
A compound, a mixture may explode under different conditions.  As an example, for some of them it is heat, other require electric discharge or mecanical impact to decompose.  There are classes of compounds with known examples of explosives (azides, picrates, fulminates) so one may infer new compounds within these classes equally might be explosives, too.

Among modern explosives, increasing the number of nitrogroups or / and increase of nitrogen content over other elements present is a theme, like octanitrocubanes.  See the Klapötke group in Munich / Germany working on 5,5’-azotetrazolate salts, too.



(dihydrazinium 5,5’-azotetrazolate dihydrazinate, source)