NexusFi: Find Your Edge


Home Menu

 





Short sale help


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,525 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
8manxv
Philadelphia PA
 
Posts: 1 since Aug 2015
Thanks Given: 0
Thanks Received: 0

Hi,
I'm trying to write a code that when a short sale is open for a sufficiently long time and is profitable that the program automatically "rebalances" the position, taking advantage of the increase in equity caused by the short sale profit.

I am currently doing this buy entering a buy to cover order for the entire position, then re-shorting the new larger number of shares. This is fine except for when shares are not available where it closes the position and is unable to re-short.

1) Is there a way to check the short inventory through easylanguage? (Using IB)
2) I've tried to only short the "profit' equity (i.e. if I had 100 shares short, the position profit gave me enough new equity for 10 shares, so I would short an additional 10 shares) but using functions under the GetPosition___ family don't seem to work.

Any ideas would be very appreciated!
Thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Second Night of US Strikes Crushes Iran June 15 to 3.6% …
Prediction Markets & Event Contracts
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Iran Forward Curve: June 30 at 56% vs June 15 at 28% -- …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
 




Last Updated on August 10, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts