0

The variable i need to set constraints for is 'x'

Where x=1 while x*3*StdDev <= MADD-DD

otherwise x = (MADD-DD)/(3*StdDev)

Also, x must always be positive

Here is my code so far for this, the if function I tried to use will not work:

MADD = 0.3 #Maximum Acceptable Drawdown

HWM_LnSh = np.maximum.accumulate(data.LnSh_Ex_return) #Compute High 
Water Marker - the running maximum
DD_LnSh = (HWM - data.LnSh_Ex_return)/HWM_LnSh #Drawdown
MDD_LnSh = np.maximum.accumulate(DD_LnSh) #Maximum Drawdown

x = 1 

if 3*annual_vol_LnSh > MADD - DD_LnSh:
 x = (MADD - DD_LnSh)/(3*annual_vol_LnSh)

My code so far , let me know if additional info is needed, Any help is greatly appreciated

0 Answers0