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

Shorting? #61

Open
mboop127 opened this issue Jun 26, 2024 · 3 comments
Open

Shorting? #61

mboop127 opened this issue Jun 26, 2024 · 3 comments

Comments

@mboop127
Copy link

Hello - I see there is support for shorting in the API itself, but I cannot see any information on how to short here. Is it possible?

@mboop127
Copy link
Author

I was able to resolve by adding "BuyToCover" and "SellShort" under tradev2's instruction parser.

@itsjafer
Copy link
Owner

Hi @mboop127, if the changes are straightforward, I'd love for you to create a pull request!

@mboop127
Copy link
Author

Frustratingly it is not longer working, I am unsure why. Below is the code I changed in TradeV2; perhaps @itsjafer you could explain why you use integers rather than the instruction codes listed in the documentation, and where I might find the integer codes? Flailing, but hoping that could be the explanation.

    if side == "Buy":
        buySellCode = "BUY"
    elif side == "Sell":
        buySellCode = "SELL"
    elif side == "Short":
        buySellCode = "SELL_SHORT"
    elif side == "Cover":
        buySellCode = "BUY_TO_COVER"
    else:
        raise Exception("side must be either Buy or Sell or short, see instruction type on dev portal")

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