Skip to content

Instantly share code, notes, and snippets.

@rian-dolphin
Last active June 15, 2022 16:55
Show Gist options
  • Save rian-dolphin/dc8601ca071fbcb577d3205d55b9c824 to your computer and use it in GitHub Desktop.
Save rian-dolphin/dc8601ca071fbcb577d3205d55b9c824 to your computer and use it in GitHub Desktop.
#-- Find index of max sharpe portfolio
max_sharpe_index = np.argmax(mean_variance_pairs[:,0]/mean_variance_pairs[:,1]**0.5)
#-- Add max sharpe portfolio as a seperate point to the plot
fig.add_trace(go.Scatter(x=mean_variance_pairs[max_sharpe_index,1]**0.5, y=mean_variance_pairs[max_sharpe_index,0],
marker=dict(color='red', size=14),
mode='markers'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment