This is hard if not impossible to code and why the human brain is still far superior to machine.
It wouldn't be that hard to code market context if you knew what to look for. How hard can it be though to get information from live feeds on gold, bonds, soft commodities, oil, various indices, various spreads etc? I would imagine it's been done already for intra day trading. I am not a coder but I know you can easily code things like if x1 says y1 and x2 says y2 then filter trades by x3 and y3 e.g. if bond yields are down and gold is up, code your system to not look for trades in indices or equities until the situation changes. The reason it works well for intra day trading is you don't need a human brain to forecast 6 months or 12 months down the track based on incomplete information. The shorter the time frames you're dealing with then it should be easier to code.