Example #1
0
 private void InsertIntoLowData(float low, int barPos, int index)
 {
     for (int i = topCalCount - 1; i > index; i--)
     {
         bottomList[i] = bottomList[i - 1];
     }
     bottomList[index] = new KLineBarInfo(klineData.GetBar(barPos), barPos);
 }
Example #2
0
 private void InsertIntoHighData(float high, int barPos, int index)
 {
     for (int i = topCalCount - 1; i > index; i--)
     {
         topList[i] = topList[i - 1];
     }
     topList[index] = new KLineBarInfo(klineData.GetBar(barPos), barPos);
 }
Example #3
0
 private int FindInsertLowIndex(float low)
 {
     for (int i = topCalCount - 1; i >= 0; i--)
     {
         KLineBarInfo klineBarInfo = bottomList[i];
         if (klineBarInfo == null)
         {
             continue;
         }
         double lowValue = klineBarInfo.KLineBar.Low;
         if (low > lowValue)
         {
             int insertIndex = i + 1;
             if (insertIndex >= topCalCount)
             {
                 return(-1);
             }
             return(insertIndex);
         }
     }
     return(0);
 }
Example #4
0
 private int FindInsertHighIndex(float high)
 {
     for (int i = topCalCount - 1; i >= 0; i--)
     {
         KLineBarInfo klineBarInfo = topList[i];
         if (klineBarInfo == null)
         {
             continue;
         }
         double highValue = klineBarInfo.KLineBar.High;
         if (high < highValue)
         {
             int insertIndex = i + 1;
             if (insertIndex >= topCalCount)
             {
                 return(-1);
             }
             return(insertIndex);
         }
     }
     return(0);
 }