I have a function that steps through all stocks in QTradableStocksUS and does some processing on the data. This processing isn't done in the pipeline because there is a lot of if statements and for loops, and I wouldn't know where to begin to implement that in the pipeline so it's just in the before_trading_start function using data.history to get most of what I need. However, after processing all the data I'm essentially left with a table of stocks and how confident I am in the price either going up or down. For my first attempt I plan on using this confidence as a metric for how to split the investments (ignore any confidences below a threshold - invest in everything else weighted with the confidence). However I'm unsure what exactly the 'objective' class entails and how I can produce data exactly as the optimise process requires for it's object.
The ideal answer to my question would be: the objective is in the following form..., you can replicate it with any dataframe assuming the columns are in the following order....