Of course, here is the formula :
Quadratic Equation ?
Try this instead https://en.wikipedia.org/wiki/Source_lines_of_code
When I set out to properly write and EA I decided that I wanted to first code all the functions that any EA I coded would need, so I did just that, I coded a set of standard functions to do the following:
Take a screenshot, Error reporting to screen and via email, Draw Fibonacci retracement, Mutex to avoid trade context busy, Trade Sizer - calculates position size based on %age risk, PlaceTrade - determines if a order should be Market or Pending and is valid then places the trade, CheckTrades - checks for missing SL & TP checks for pending orders becoming invalid, Spread MA function, Watchdog - checks for losing runs of x trades or more checks that losing trades are losing the correct value, trading error handler, Comments as Labels, Status messages
these functions are all reusable and amount to a couple of thousand lines of code . . .
to know the relation of complexity to profitability
Seriously ? There is no relation between complexity and profitability. And there is probably neither relation between the number of lines of code and complexity.
Anyway if someone would like to check this, he can make a study based on the Codebase.
i feel the more lines of code means more complex.
another things is to check if profitable ea are simple or more complex