Just google moment js stock trade. It’s on npm. I’ll try to find it again
Okay for trading, there’s a few things to watch out for.
First, RH limits their api heavily. When you query your orders or portfolio, you are givin info, but not the stocks name. So you have to also query the instrument url.
The calls rack up quick, I built a cache mechanism, when an order comes in, I create a hash of that object for the key, I use the instrument url as the key for instruments. So when I requested it, I’ll find it in cache.
Pretty much I have a cache first system. Everything hits the cache first which then calls the api. I hardly speak to RH unless I’m placing a order. Testing is important. What o did is log each function to make sure they all worked when I detected something in Q
The next thing I did was modify the order, day one, I only let it place quantity of 2, today I let it work with 10. If something goes wrong. It’s only got a little