No need to reinvent the wheel. Take an existing bot and modify for your needs. I wasted several months on my own code until I dug deeper into what is out there. My code was usable,but still just the basics. With existing, you get the basics for free and you get to build something advanced more quickly.
For nodejs I run Gekko. Search for it here or Github.
Yess thats a good idea. Thanks for the pointer, I will take a first look at Gekko.
So I was wondering.. What happens when you see a trading opportunity? Do you place a limit order at one of the open bid-ask prices or do you come in with a market order? How do you check if the trade was really executed?