public static double getMA5Value(StockKLineBaidu kl) { return(kl.ma5.avgPrice); }
//public bool isRangeBeyond(List<StockKLineBaidu> arr, double range, extractDataMethod method, bool positive = true) //{ // if (arr == null || arr.Count < 2) // { // return false; // } // double startVal = method(arr[0]); // double endVal = method(arr.Last()); // double val = (endVal - startVal) / startVal; // if (positive) // { // return (val > range); // } // else // { // return (val < range); // } //} //public bool isRangeWithin(List<StockKLineBaidu> arr, double range, extractDataMethod method) //{ // if (arr == null || arr.Count < 2) // { // return false; // } // double startVal = method(arr[0]); // double endVal = method(arr.Last()); // double val = (endVal - startVal) / startVal; // return (Math.Abs(val) <= range); //} //public bool isDiffBeyond(List<StockKLineBaidu> arr, double diff, extractDataMethod method, // double subDiff, extractDataMethod subMethod, bool positive = true) //{ // if (arr == null || method == null) // { // return false; // } // int i = 0; // for (i = 0; i < arr.Count - 1; i++) // { // double curVal = method(arr[i]); // double nextVal = method(arr[i + 1]); // double curSubVal = subMethod(arr[i]); // double nextSubVal = subMethod(arr[i + 1]); // double val = (nextVal - curVal) / curVal; // double subVal = (nextSubVal - curSubVal) / curSubVal; // if (positive) // { // if (val < diff) // { // if (subVal < subDiff) // { // break; // } // } // } // else // { // if (val > diff) // { // if (subVal > subDiff) // { // break; // } // } // } // } // if (i < arr.Count - 1) // { // return false; // } // return true; //} //public bool isDiffWithin(List<StockKLineBaidu> arr, double diff, extractDataMethod method, // double subDiff, extractDataMethod subMethod) //{ // if (arr == null || method == null) // { // return false; // } // int i = 0; // for (i = 0; i < arr.Count - 1; i++) // { // double curVal = method(arr[i]); // double nextVal = method(arr[i + 1]); // double curSubVal = subMethod(arr[i]); // double nextSubVal = subMethod(arr[i + 1]); // double val = (nextVal - curVal) / curVal; // double subVal = (nextSubVal - curSubVal) / curSubVal; // if (Math.Abs(val) > diff) // { // if (Math.Abs(subVal) > subDiff) // { // break; // } // } // } // if (i < arr.Count - 1) // { // return false; // } // return true; //} public static double getCenterPrice(StockKLineBaidu kl) { return(kl.getCenterPrice()); }