Someone put me out of my misery please! I can't see the forest for all those trees. I have a populated Deedle frame which is effectively of type:
Frame<int, string> MyPopulatedFrame
I won't bore you with the initial population routine, but it prints out fine with "value1" and "value2" columns, no issues.
value1, value2
1,2
10,5
100,200
etc etc
I can then add this code to sum the two columns, which also works fine over the whole series:
MyPopulatedFrame.AddColumn("value1add2", PairOHLCVFrame.GetColumn<double>("value1") + PairOHLCVFrame.GetColumn<double>("value2"));
It gives me a delightful little calculated column on the end of my frame with the correct value in each of the rows. i.e.
value1, value2, value1add2
1,2,3
10,5,15
100,200,300
etc etc
What I would really like to do is populate another column with a 1 or 0 dependent upon value1 being greater than value2. The code ought to look something like this:
MyPopulatedFrame.AddColumn("isValue1GreaterThanValue2", PairOHLCVFrame.GetColumn<double>("value1") > PairOHLCVFrame.GetColumn<double>("value2") ? 1 : 0);
but that won't even compile. Giving a design time error of:
"Operator '>' cannot be applied to operands of type 'Series<int, double>' and 'Series<int, double>'"
I know the answer to this must be simple, but it's a case of getting there before my laptop lands in the garden...