Coder Social home page Coder Social logo

Comments (10)

chranga avatar chranga commented on September 27, 2024 1

Hey guys, I think the issue is from the ATR function, called in the renko_DF function.
df2.brick_size = round(ATR(DF,120)[-1],0)

The reason for the NaNs is because of the ATR for the Malaysian ticker.
Try the below

print(round(ATR(ohlc,120)[-1],0))
print(ATR(ohlc,120)[-1])

Output is 0, when rounded and 0.0594166616598765

So in the renko_DF function, just change df2.brick_size = round(ATR(DF,120)[-1],0) to df2.brick_size = round(ATR(DF,120)[-1],1)

Which gives an ATR of 0.1 and the NaN doesnt appear anymore.

Alternately, just assign a df2.brick_size = with a fixed value (to get the fixed brick size) and it will work.

Also note that you will get NaN's whenever a stock price < 1. I think by simply adding an if/else statement within the function to check if price is > 1 or < 1 and set the rounding to 0 or 1 will help resolve the issue. closes #18

from stocktrends.

ChillarAnand avatar ChillarAnand commented on September 27, 2024

Thanks, @tys203831

Can you please provide a sample csv file that you were using for this?

from stocktrends.

Umairnaseem1 avatar Umairnaseem1 commented on September 27, 2024

Hello @tys203831

have you resolved this issue ? as I am facing a similar problem in my project. It would be very helpful if you can guide me thanks

from stocktrends.

ChillarAnand avatar ChillarAnand commented on September 27, 2024

Related to #23

from stocktrends.

Prasanna28Devadiga avatar Prasanna28Devadiga commented on September 27, 2024

Is there a way to fix this @ChillarAnand?
Also it will be great if you can let us know why this issue is arising. So that we can avoid such cases for the timebeing

from stocktrends.

ChillarAnand avatar ChillarAnand commented on September 27, 2024

I am not able to reproduce the issue. @Prasanna28Devadiga

If someone can share sample data to reproduce this issue, it will be helpful.

from stocktrends.

Prasanna28Devadiga avatar Prasanna28Devadiga commented on September 27, 2024

@ChillarAnand Here is a sample data that i was facing the issue with:
https://drive.google.com/file/d/1mt_T3wH2ICaqCG6UcR9kkyEWpH-hV9dB/view?usp=sharing
It is the Intraday (1 minute) data for 'IDEA' stock downloaded from the yfinance api.

from stocktrends.

Prasanna28Devadiga avatar Prasanna28Devadiga commented on September 27, 2024

@ChillarAnand were you able to find out what exactly is going wrong/ ways to workaround ?

from stocktrends.

ChillarAnand avatar ChillarAnand commented on September 27, 2024

@chranga Thanks for submitting detailed report.

Would you like to send pull request for the same?

from stocktrends.

chranga avatar chranga commented on September 27, 2024

@chranga Thanks for submitting detailed report.

Would you like to send pull request for the same?

Hi, a bit new to this. But I edited the above comment with closes #18 but it doesnt seem to work?

from stocktrends.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.