I want margin of a custom, fictional set of positions; and not of my current portfolio or open orders. Secondly, I believe the functions order_margins and basket_order_margins can be used only on a subset of open orders, is that right?
You can use margins api for any order or list of orders,they are not related to open orders/positions. However,you can use consider_positions parameter to include your current positions in the basket margins calculation.
Read in detail here:.https://kite.trade/docs/connect/v3/margins/
Read in detail here:.https://kite.trade/docs/connect/v3/margins/