GregoryMorse / trendln

Support and Resistance Trend lines Calculator for Financial Analysis
MIT License
663 stars 162 forks source link

Example test code #7

Closed martinbouhier closed 4 years ago

martinbouhier commented 4 years ago

Can you share an example code file? Because when I try to run I saw "NameError: name 'h' is not defined"

GregoryMorse commented 4 years ago

Hi, thanks for the report, can you show me the code that you ran which gave that error? I checked and could not find a way that h would be undefined - but if there is a bug I'd like to know. The example on the main page should work - its a bit in a couple fragments but should run in the Python interpreter easily enough.

tahmi123 commented 4 years ago

Can you share an example code file? Because when I try to run I saw "NameError: name 'h' is not defined" i get this error too, after cleaning the code

GregoryMorse commented 4 years ago

Please can you give a stack trace in the original (non-cleaned code) as when I test or browse the code I find no such issue. I will provide you with an example file, but I need to know the bug regardless especially if 2 separate reports experience it.

RajeshDhalange commented 4 years ago

Line no 44 is comma is missing? hough_scale=0.01

Line no 144 what is idx? Error is "Unresolved reference 'idx'"

Line no 21 and 78 h, for h Error is "Unresolved reference 'h'"

GregoryMorse commented 4 years ago

Okay the problem is the readme. I have mixed example code and API reference documentation. Running the API reference documentation of course will not work hence the issue with h and idx and thank you for the hough_scale comma bug. I am updating this right now. example.py will be there as an example which can be run out of the box.

Should all the code in readme be runnable? Since it seems so I will need to make some minor changes so no more issues in this regard occur.

GregoryMorse commented 4 years ago

Please see: https://github.com/GregoryMorse/trendln/blob/master/example.py

The readme is also improved here: https://github.com/GregoryMorse/trendln/blob/master/README.md

This should solve both the request for an explicit example file, along with the errors which were reported due to some mistakes in the readme documentation. If anything is broken still, please reopen this issue.