def marginWithheld(openPositions):
    """
    Calculates the margin withheld in the open positions.

    Parameters-
    openPositions: Array of open positions.
    """

    totalMargin = 0.0
    for position in openPositions:
        totalMargin += float(position['margin'])

    return totalMargin