I have exactly the same macbook, and the same issue. Nothing seems to help so far, nothing in the logs, nothing. Just from time to time, horizontal lines appear on the screen - both internal and external display alike.
I tried to pin it down to GPU intensive tasks, but having 3d benchmark application run for some time, I havent noticed flickering/artifacts. Changing resolution, automatic GPU switching, reinstallation of osx/macosSierra doesnt help. It usually appears in osx interface and in windowed applications, rather than in 3d games or full-screen applications.
Anyway guys, this is a hardware problem, I suspect bad GPU memory. I tried to bring laptop back to the shop, but they havent figured anything. Since we dont have official Apple stores in my country, and my guarantee will end in next month, I guess thats it. Apple again have failed to deliver quality assurance to dual-GPU laptops.
Not sure that my next laptop will be from Apple. Come on guys, MAKE APPLE GREAT AGAIN! 🙂