Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32004/WalkForwardTesting/WalkForwardLag
Modified Files:
WeightedPositions.cs
Log Message:
Added Reverse method, for reversing sign of weights in the weighted position collection.
Now the file must be moved to the Business project (I will not modify the file until then).
Index: WeightedPositions.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositions.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** WeightedPositions.cs 12 Aug 2007 19:09:41 -0000 1.9
--- WeightedPositions.cs 15 Aug 2007 14:25:24 -0000 1.10
***************
*** 561,564 ****
--- 561,573 ----
return openToCloseReturn;
}
+ /// <summary>
+ /// Reverse the sign of each weight for each position in the current instance:
+ /// long positions become then short positions and viceversa
+ /// </summary>
+ public void Reverse()
+ {
+ foreach(WeightedPosition weightedPosition in this)
+ weightedPosition.Weight = - weightedPosition.Weight;
+ }
}
}
|