NexusFi: Find Your Edge


Home Menu

 





Short sale help


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,425 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?
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
Iran War Prediction Markets: Ceasefire 16%, Ground Invas …
Prediction Markets & Event Contracts
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks




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