I need to be able to determine whether a particular "trade" (indicated by "signal") resulted in a profit or loss by indicating a win or loss. I need Python to check the next location in the High and Low lists for an increase in value equal to or greater than 2.5% at some point beyond the entry signal. However, I also want Python to determine if the value drops 3% or more prior to appreciating 2.5% or more. Unfortunately, the code I developed so far doesn't seem to be working. What am I missing?
Signal = [1,5,7]
Close = [5,10,10,10.5,11,12,11.9,14,14,15,16]
High = [7,10.2,10.1,11,12,12.1,12.2,14.5,18,19,20]
Low = [4,9.9,9.8,10,10,11.8,11.8,12,13.8,13.85,14]
for i in Signal:
Entry = []
Entry.append(Close[i])
for Ent in Entry:
print [Ent]
for Value in High[i+1:]:
Profit = ((Value - Ent)/Ent)*100
for Value in Low[i+1:]:
Loss = ((Value - Ent)/Ent)*100
while (abs(Loss) < 3):
if Profit >= 2.5:
print 'Win'
break
else:
print 'Loss'
break