also remember your broker reserves the right to raise margin req on you.. and of course the exchange can raise there margin req on you to...
In case of using IB: you can submit a "what-if" order in TWS, instead of a real order. The resulting pop-up window calculates and shows the margin implications of the order you are trying to submit. Apparently are you even able to generate a complete what-if portfolio, including margin analysis: https://www.interactivebrokers.com/...eriskanalytics/Create a What-If Portfolio.htm