LuckysonKhaidem / StockMarketPedicition

23 stars 24 forks source link

Technical indicators are looking ahead in time #1

Open BFODonnell opened 6 years ago

BFODonnell commented 6 years ago

Two of your technical analysis functions in TechnicalAnalysis.py are looking ahead in time instead of using history. These are 'getWilliams(x)' and 'getStochasticOscillator(x)'. They both use this code:

for i in xrange(n-13):
    highestHigh.append(high[i:i+14].max())
    lowestLow.append(low[i:i+14].min())
Volodymyr1983 commented 6 years ago

Brian, what result have you achieved with the right code? Is it the same or completely different?

islermurat commented 3 years ago

actually it looks back of the return value. so no problem, otherwise, the indicator will have wrong result.