bwentzloff / trading-bot

Code seen in Cryptocurrency Trading YouTube video here: https://youtu.be/fpqzXgZjSqM
400 stars 262 forks source link

Part3 error #33

Open r-neri opened 6 years ago

r-neri commented 6 years ago

Using the part 3 backtest.py this error occur any guess how to resolve this ?

File "C:\Users\rogerio.LAPTOP_ROGER\PycharmProjects\Part3_bot\botstrategy.py", line 32, in evaluatePositions if (self.currentPrice < self.indicators.movingAverage(self.prices,15)): TypeError: '<' not supported between instances of 'float' and 'NoneType'

DutchPython commented 6 years ago

Same problem here

r-neri commented 6 years ago

Ok i found the problem. This occurs only in the first time of the function mkvingAverage is called. On this situation ths function doesent returns any value so raise the error. To correct this change the fuction and include a elseof statement to return a value

vinny9592 commented 6 years ago

i have the same problem and the solution above doesn't help. anyone else have a way to overcome?