This is hopefully a simpler way to optimize a long only portfolio weighting on Interactive Brokers with a mix of ETF and currencies.
This works off here
Demo free Yahoo Finance portfolio data with ETFs and forex for max return
You can learn more how I approach this for Interactive Brokers https://quantlabs.net/blog/contact-us/