Learn practical skills, build real-world projects, and advance your career

What's the maximum leverage can be offered per day?

  • Idea: to set balance sheet size as a variable, the maximum leverage for all margin orders is the output, and use June 16 as a sample day.

  • What's controlled?

    • Portion of orders on margin. Consider 60%, 70%, 80%, 90%.
    • Among margin orders, ratio of opening position to closing position. Consider 90-10, 80-20, 70-30, 60-40.
import numpy as np
import pandas as pd
from scipy.stats import norm

from scipy.stats import bernoulli

import data

Data used: real orders placed on June 16 of SFOX.

df1 = pd.read_csv(r'C:\\Users\\xlj19\\Desktop\\SFOX\\risk_modelling\\2020mindata.csv').set_index('Period')
df2 = pd.read_csv(r'C:\\Users\\xlj19\\Desktop\\SFOX\\risk_modelling\\2020March15MinData.csv').set_index('Period')
df3 = pd.read_csv(r'C:\\Users\\xlj19\\Desktop\\SFOX\\risk_modelling\\2020AprilMinData.csv').set_index('Period')
df4 = pd.read_csv(r'C:\\Users\\xlj19\\Desktop\\SFOX\\risk_modelling\\2020MayMinData.csv').set_index('Period')
df1.index = pd.to_datetime(df1.index)
df2.index = pd.to_datetime(df2.index)
df3.index = pd.to_datetime(df3.index)
df4.index = pd.to_datetime(df4.index)