From VBA to Python

Years ago I programmed some macros in Eikon that capture and save in a folder on his PC hard disk the graphs of about 200 RICs (stocks, indices, currencies, etc.). They are graphs that have studies, annotations, trend lines, Fibonacci, and that are generated in daily and weekly format. The macros convert all the graphics in his Eikon quotelists one by one to jpg format, and are the ones that are saved to a folder daily. Now I have Workspace, and I have been told that WS doesn't suppor VBA, but Python.How can I convert my VBA macros into Python? I would really appreciate if somebody could guide me, as I don't know Pyhton....

Best Answer

Answers

  • Hi @jurraca

    I would suggest you review the pages under the Upgrading to Workspace within the Developer Portal.

  • hi @nick.zincone . I did, but honestly, the solution that I have been provided with is reprogramming my VBA macros into Python. And the issue is that I don't know anything about Python.

    It would be great if somebody could illustrate and guide me: I could check my VBA macros and how to adopt them to Python with this person that would be willing to help me.

    Thank you so much if someone here could help.

    Juan

  • Thanks for your answer, @jonathan.legrand. I really appreciate it. But honestly, I haven't been able to find out how to save a chart as image from Workspace in another folder, I don't know where it can be or how I can do it (and believe me I have tried hard). Any idea/input/suggestion?

  • Hi @jurraca, I understand, it can be overwhelming switing to a new coding environment.


    As an example, I thought it best to use a piece I wrote in the __Examples__ folder in CodeBook, specifically "__Examples__/03. Quantitative Analytics/03.08. Curves/Cross_Currency_Curves.ipynb".

    In this example, if you run all but the last cell (that closes your session which you need opened to create a curve), you can choose the currency pair you'd like to choose a curve for, along with details you can choose in drop downs:

    1723634543013.png


    If you place your cursor anywhere in the red box I drew in the screenshot above, a menu appears at the top right. You can choose there to download the image as an image if you choose to:


    1723634612664.png


    Note that this is only one of many ways to get an image out of your code, you can programmatically ask for images to be outputted using, for e.g., Matplotlib.