Hi @sujith ,
Am I missing something here? How have you initialized the stoploss value?
trigger = price - (co_upper * price)
if stoploss < trigger:
stoploss = trigger
else:
trigger = stoploss
Thank you very much for your response! Really appreciate it.
I think, I got the the solution. As mentioned in my post, it was working fine on the python prompt but while executing the file, it was giving that error.
The problem is, in my virtual e…