Execute code after the Performance tab has been updated + access data in Performance tab
Author: kribel
Creation Date: 4/8/2013 9:59 AM
profile picture

kribel

#1
Hi all,

Is it possible to execute some code after the Performance tab has been updated? I also would like to access the data in the performance tab.

Is there a way to do this?

Many thanks,
Konstantin
profile picture

Eugene

#2
No, it's not possible to execute Strategy code at this stage. By this time, Strategy has already finished executing.

But if you tell us what kind of performance data you're trying to access, and what for, then we might think of a workaround.
profile picture

kribel

#3
Hello Eugene,

I just want to print some data in the status bar. Some data I would like to take directly from the Performance tab some of the data I would need to calculate using the data from the Performance tab. For example, I would like to have the maximum draw down in the status bar and the MAR ratio etc.

Many thanks,
Konstantin
profile picture

Eugene

#4
You're about to open a can of worms with this innocuous "just" because it's not that easy.

1. In Wealth-Lab, Strategies do not have access to the performance backtest results because, as mentioned above, Strategy has already finished executing by the time Wealth-Lab gives control to Performance Visualizer.

Having said that, to access the data you'd have to resort to this workaround: WealthScript Techniques | Interacting Dynamically with Portfolio Level Equity

2. There is no easy access to a performance metric "here" and another number "there". You would have to either reuse it (e.g. leverage the PerformanceEngine.cs class from MS123 Visualizers demo source, passing it the obtained SystemPerformance object) or code it from scratch (if not available).

It all takes certain effort and programming skills.
profile picture

kribel

#5
Effort and programming skills are not a problem.

Is it possible to inherit from a MS123 Visualizer/Scorecard reuse it and just modify a method to print the data? Then add it as a new score card and voila I would have the data in the performance tab and the status bar.

What do you think?

Cheers,
Konstantin
profile picture

Eugene

#6
I think there's a catch: neither Visualizer nor Scorecard are able to print to the status bar. That's member of the WealthScript interface (PrintStatusBar).

Here's a little trick that might print to the status bar from an external class, untested and unsupported:

CODE:
Please log in to see this code.


The rest is up to thee.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).