Skip to content

add: dynamic price increment.#46

Open
arshamalh wants to merge 1 commit intorgaveiga:mainfrom
arshamalh:main
Open

add: dynamic price increment.#46
arshamalh wants to merge 1 commit intorgaveiga:mainfrom
arshamalh:main

Conversation

@arshamalh
Copy link
Copy Markdown

Current price increment is 0.01 and hard-coded. it causes making many x, y points in some circumstances.

Making this value dynamic and adjustable is helpful specially in cases that the project is used as library for API's, decreasing unnecessary payload size (I faced 16K pairs once).

@rgaveiga
Copy link
Copy Markdown
Owner

rgaveiga commented Nov 2, 2025

Reviewing the PR soon.

@rgaveiga
Copy link
Copy Markdown
Owner

rgaveiga commented Nov 9, 2025

Current price increment is 0.01 and hard-coded. it causes making many x, y points in some circumstances.

Making this value dynamic and adjustable is helpful specially in cases that the project is used as library for API's, decreasing unnecessary payload size (I faced 16K pairs once).

I understand the argument about the potential gains when the library is heavily used, but one issue here is that the PL of each leg of a strategy is calculated for each stock price point, cent by cent, and then summed to obtain the PL of the entire strategy. It's based on the PL that the PoP will then be calculated and, soon (work in progress, slow progress, I know...), the expected profit and loss ​​will also be determined. If the price spacing changes, the PL calculation changes, and this would also affect the PoP and other calculations.

One alternative to save memory would be to use generators, but it would be necessary to consider the impact on performance of using them instead of a static numpy array.

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.

2 participants