Getting Best/Current BID & ASK price into a strategy
Greetings everyone this is my first time posting. So I've been playing with gekko for a few weeks and its been great but one of the things that I like to use in my strategy is using the bid/ask price to help filter out some whipsawing. I figured it would not be that hard too do, I come from a c++ background so I'm kinda new to Javascript but nothing like jumping in feet first and figuring out how things/gekko works. So I started off looking at the wiki page to see how the program is laid out it pointed me to budfox from there I  followed the data trail back to candleCreator and my exchange wrapper which I'm using gdax. So after messing around and breaking things and then unbreaking things I got to the point were if i printed the candle object I could see the ask and bid but it was undefined upon closer inspection I see how gekko is creating candles by using the getTrade api which does not include the bid/ask in the datastream. But I see in the gdax api wrapper that it does have the getTicker function which does include ask/bed price. But I'm at a lose on how to add the ask/bid from getTicker into the getTrade function.
Any thought or help would be greatly appreciated.

Thank you
Travis Wilson
P.S Thanks for all the hard work that people are putting into this program. You guys/ladies are really awesome.
One of the things I forgot to mention is that I was able to use the gdax libary to open a socket and grab the ask/bid from the server directly from the strategy code so that I can use it when running a live trade but if I run a back test it just polls the hell out of gdax api server on every update which is a no go and it would be nice to use it in a backtest but for now I do have the data I need when only running live.

Thanks again
Travis Wilson
So after going over a few exchange API documentation and looking at how Gekko gets its data from the exchange. Getting ask/bid price historically does not seem possible from the exchange its self. So the only way I can see this being possible is to write my own program that uses a web socket to fill a database with ticker data and then change Gekko's martketFetcher code to grab data from my program/database instead of the exchange so I would only be able to use the data that I've collected to do backtesting.
Does this sound about right askmike?

Forum Jump:

Users browsing this thread: