Hi there,
My users have requested I provide a way for them to enter formulas to work on the data they work with (stock prices). For example, they want to be able to enter a formula along the lines of ((Price < 50.00) OR (Price < TodaysLow)) AND (TodaysVolume > 50000), and if that evaluates to true then perform some action.
I am not sure how best to go about this? I was thinking maybe looking at Linq Expression Trees but I can't figure out how to design code so that comparison values can be either actual values or the contents of fields / properties / methods on other objects, nor of how to deal with nested ANDs / ORs, and brackets.
Ideally I would like to avoid hard coding large switch statements so that if I add another property to an object down the line it will automatically be available to the formula builder (I assume some sort of reflection will be needed for this).
Anybody ever done anything like this, or where I might be able to look online to learn how to do this?
Cheers!
Loading
Andry LebedevPosted Oct 3, 2011, 2:18 AM
However, with the ">" there are small features ..
yet, devexpress has a similar editor, but there can only enter a logical formula
Good luck
Kuma vPosted Mar 23, 2009, 4:47 PM