добавил файл action
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Details
parent
20920c6832
commit
467cd68e73
|
@ -0,0 +1,9 @@
|
||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
@ -4,7 +4,7 @@ namespace KLHZ.Trader.Core.Declisions.Utils
|
||||||
{
|
{
|
||||||
internal static class HistoryProcessingInstruments
|
internal static class HistoryProcessingInstruments
|
||||||
{
|
{
|
||||||
internal static PeriodPricesInfo GetPriceDiffForTimeSpan(this PriceHistoryCacheUnit unit, TimeSpan timeShift, TimeSpan timeSpan)
|
internal static PeriodPricesInfo GetPriceDiffForTimeSpan(this PriceHistoryCacheUnit unit, TimeSpan timeShift, TimeSpan timeSpan, int? pointsShift = null)
|
||||||
{
|
{
|
||||||
var res = new PeriodPricesInfo(false, 0, 0, 0, 0, 0, timeSpan, 0);
|
var res = new PeriodPricesInfo(false, 0, 0, 0, 0, 0, timeSpan, 0);
|
||||||
var data = unit.GetData();
|
var data = unit.GetData();
|
||||||
|
@ -19,9 +19,11 @@ namespace KLHZ.Trader.Core.Declisions.Utils
|
||||||
|
|
||||||
var intervaEndIndex = -1;
|
var intervaEndIndex = -1;
|
||||||
var intervaStartIndex = -1;
|
var intervaStartIndex = -1;
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
for (int i = times.Length - 1; i > -1; i--)
|
for (int i = times.Length - 1; i > -1; i--)
|
||||||
{
|
{
|
||||||
if (times[i] <= intervalEnd && intervaEndIndex < 0)
|
if ((times[i] <= intervalEnd || (pointsShift.HasValue && count < pointsShift.Value)) && intervaEndIndex < 0)
|
||||||
{
|
{
|
||||||
intervaEndIndex = i;
|
intervaEndIndex = i;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +42,7 @@ namespace KLHZ.Trader.Core.Declisions.Utils
|
||||||
if (intervaStartIndex != intervaEndIndex && intervaEndIndex >= 0)
|
if (intervaStartIndex != intervaEndIndex && intervaEndIndex >= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intervaStartIndex >= 0 && intervaEndIndex >= 0)
|
if (intervaStartIndex >= 0 && intervaEndIndex >= 0)
|
||||||
|
|
Loading…
Reference in New Issue