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

Long short position #4

Open
lukaspistelak opened this issue Nov 29, 2022 · 1 comment
Open

Long short position #4

lukaspistelak opened this issue Nov 29, 2022 · 1 comment

Comments

@lukaspistelak
Copy link

How to set positionSide ="SHORT" or "LONG" in create_order _? quite basic options, I can't find any code in your lib...

Thanks!

@iaverin
Copy link
Contributor

iaverin commented Nov 29, 2022

wow have not updated this lib for a quite long ) So, not sure if it's still working with actual exchanges )

However, under the hood of ztom is the ccxt lib, which is responsible for essential communicating with exchanges.

Ztom adds limit order management capabilities, like watching the order's status, restricting order's lifetime, or cancelling order if the price have been changed and etc. If you are looking for this kind of features I could try to rehabilitate the lib and check if it's still functional in respect to exchanges API updates and etc. Please tell me your use case and I could try to provide you with the solution.

If you are looking just for basic exchange wrapper - please refer to ccxt and it's create_order method https://docs.ccxt.com/en/latest/manual.html#placing-orders


order1 = FokOrder("ABC/XYZ", 1, 5, "sell", max_order_updates=3, time_to_cancel=0.5)
# as referred in FokOrder
# implement basic FOK order by limiting maximum trade order updates and than cancel
 # def __init__(self, symbol, amount: float, price: float, side: str, cancel_threshold: float = 0.000001,
                 max_order_updates: int = 10, time_to_cancel: float = 0.0):
# where "side" represents SHORT or LONG: "sell" for SHORT and "buy" for LONG

Example is here https://github.com/ztomsy/ztom/blob/master/tests/test_fok_order.py#L63
Also there a examples of implementation of some complex order's logic: https://github.com/ztomsy/tkg-pro/blob/master/tkgpro/threshold_order/threshold_order.py

Please drop me a mail if want to continue discussion [email protected]

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

No branches or pull requests

2 participants