#During the first loop of this method, previousPrice will still be 0 here,
#because it was set to currentPrice above, which also was 0 before we updated
#it above via getBitMexPrice().
#So, when we reach this point during the first loop, previousPrice will be 0
#while currentPrice would have just been updated via getBitMexPrice().
#We don't want to create the impression that the price shot up from 0 to
#currentPrice.
#ThereFore, if previousPrice == 0.0, it must be set equal to currentPrice here.
current_price = 0.0
print("First loop current_price is "+str(current_price))
previous_price = current_price
print('First loop previous_price is '+str(previous_price))
def getBitMexPrice():
current_price = int(input("Enter current price: "))
return current_price
current_price=getBitMexPrice()
if previous_price == 0.0:
previous_price = current_price
print("Current price set to "+str(current_price))
print("Previous price updated to "+str(previous_price))