Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dividend, All Sector Gainers and Loosers #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gogulnathv
Copy link

@gogulnathv gogulnathv commented Mar 2, 2022

Dividend, All Sector Gainers and Loosers

@asrafalih asrafalih self-requested a review March 3, 2022 15:48
@asrafalih
Copy link
Member

@gogulnathv Please add some description about this PR.

Copy link
Member

@asrafalih asrafalih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add test cases for those new methods.

@@ -4,18 +4,22 @@ import { IndexEquityInfo } from './interface'
const nseIndia = new NseIndia()

export const getGainersAndLosersByIndex = async (indexSymbol: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this 'indexSymbol' param as optional. So that user need not pass 'all' as index symbol. If 'indexSymbol' is undefined consider it as 'all'

src/index.ts Outdated
@@ -105,6 +106,9 @@ export class NseIndia {
getEquityCorporateInfo(symbol: string): Promise<EquityCorporateInfo> {
return this.getDataByEndpoint(`/api/quote-equity?symbol=${encodeURIComponent(symbol)}&section=corp_info`)
}
getEquityCorporateActionsDividend(symbol: string): Promise<EquityCorporateInfo> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the method name as 'getEquityDividend'

})
return {
gainers: gainers.sort((a, b) => b.pChange - a.pChange),
loosers: losers.sort((a, b) => a.pChange - b.pChange)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 'loosers' instead of 'losers'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants