Coder Social home page Coder Social logo

omspy's People

Contributors

soumyarai2050 avatar uberdeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omspy's Issues

timestamp not to be modified

timestamp should not be changed if an order is retrieved from database or populated.
Don't overwrite timestamp if it already exits


same object in memory for order

When creating a peg order from an existing order, orders have different id in memory.
I think a copy of the object is created in memory when an existing order is added to
any type of peg order. Using the same order object everywhere would be better for updates.
Need to discuss more about the pros and cons of this approach.


pending quantity to be updated

Pending quantity to be updated when an order is updated.
It could be updated based on status or comparing filled quantity with total quantity


manage retries on order execution

Use the retries attribute to manage retries on execution

retries: int = 0

When an order is retried, add it to the retries attribute and when the max retries is hit, cancel the order.
An order would be retried if we don't get any response from the broker.

Add number of modifications

Count the number of modifications made.

def modify(self, broker: Broker, **kwargs):

This is helpful for taking action after some limit is hit since a lot of brokers has a cap on the number of modifications

expiry value taken from timestamp

the expiry time of an order is calculated at the time of order generation
using the timestamp field but the timestamp gets updated when an order
update is run. The initial timestamp should not change

Quote should not have orders within

file: models.py

class Quote(BaseModel):
price: float
quantity: int
orders: Optional[int] = None

unless I am missing something (please clarify):
Quote should not have orders within - if this field represents participating order's id - the field should be an optional list of int instead

modify to restrict to certain fields

restrict modify method to only few fields, since modification to all fields are not supported by brokers
example fields to restrict: symbol, side etc

infer order type

Automatically infer order type from arguments if order type not given explicitly

  1. If price is 0 and trigger price is 0, then MARKET
  2. If price is given and trigger price is 0, then LIMIT
  3. If trigger price is given and price is 0, SLM
  4. If trigger price and price given, SLL

Raise an error if prices are not in accordance with the order types

finvasia.yaml file not found anywhere in repo

File: tests/brokers/test_finvasia.py

@pytest.fixture
def mod():
with open("omspy/brokers/finvasia.yaml") as f:
return yaml.safe_load(f)

file finvasia.yaml is not found anywhere in repo

typing error

Shows up typing error when mypy is run on the base folder

order_id = broker.order_place(**order_args)

omspy/base.py:258: error: Argument 1 to "order_cancel" of "Broker" has incompatible type "**Dict[Any, Optional[Any]]"; expected "str"
omspy/order.py:173: error: Argument 1 to "order_place" of "Broker" has incompatible type "**Dict[str, object]"; expected "Broker"
omspy/order.py:173: error: Argument 1 to "order_place" of "Broker" has incompatible type "**Dict[str, object]"; expected "str"
omspy/order.py:173: error: Argument 1 to "order_place" of "Broker" has incompatible type "**Dict[str, object]"; expected "int"
omspy/order.py:193: error: Argument 1 to "order_modify" of "Broker" has incompatible type "**Dict[str, Union[str, None, float]]"; expected "str"
omspy/order.py:199: error: Argument "order_id" to "order_cancel" of "Broker" has incompatible type "Optional[str]"; expected "str"
omspy/order.py:237: error: Too many arguments for "Order"

randrange error when numbers are same

randrange function returns error when start and stop numbers are the same.
This happens when the 2 numbers selected are the same.
If the numbers are same, the stop must be incremented by one

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.