samuraitaiga / py-metatrader

metatrader library for metatrader
Apache License 2.0
90 stars 48 forks source link

How to print optimization report? #8

Closed moor168 closed 6 years ago

moor168 commented 6 years ago

Hi Samuraitaiga: First of all, thank you for your project! I tried flowing code

ret = backtest.optimize() print ret.profit

and it shows up the error message:"OptimizationReport instance has no attribute 'profit' ". Can you show me the corret way to print optimization report? I need the params and their profits. Thanks!

moor168 commented 6 years ago

Solved by using for each_list:

ret = backtest.optimize() for each_list in ret.results: a= [each_list.param] print a[0]