We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Automatically recalculating dependant formulas

I have created a custom function that returns real-time data from the Reuters network.

I am using the CalcQuick class to define formulas that use the real-time data. The custom function is called “REUTER and is passed a string parameter that defines what data to capture.

this.calculator["Bond Turnover 2017"] = "=REUTER('NZSPREAD,IRGROW,3,1,48,5')";
this.calculator["IIB 2016"] = "=REUTER('NZG0216=FISW,HS_CODE')";
this.calculator["TEST"] = "=([Bond Turnover 2017] + [IIB 2016])/2";
this.calculator["TEST1"] = "=REUTER('NZSPREAD,IRGROW,3,1,48,5') + REUTER(\"NZG0216=FISW,HS_CODE\")";
this.calculator["TEST2"] = "=[TEST]*2";

In the example above, when a new value arrives from Reuters for the “Bond Turnover 2017”, I would like to recalculate the “Bond Turnover 2017” value and have all other dependant values (eg “TEST”, and “TEST2”) recalculated automatically and just be notifed via the ValueChanged or ValueSet events when this happens.




1 Reply

AD Administrator Syncfusion Team December 7, 2006 12:22 PM UTC

Here is a sample that I think does what you described.

http://www.syncfusion.com/Support/user/uploads/Calc_Update_3d0f3531.zip

A comment is that the CalcQuick object will not have any way of knowing that a new value has arrived from your Reuter source unless that Reuter source raises an event when one of its values has changed. So, in the sample, a ReuterChanged event was added and is raised when a timer event changes the values provided by Reuter. In this way, you can listen for this event and force CalcQuick to recalculate when this changed event comes in.

Loader.
Live Chat Icon For mobile
Up arrow icon