gpt4 book ai didi

c# - ta-lib计算的数据顺序是什么

转载 作者:行者123 更新时间:2023-12-01 16:25:17 25 4
gpt4 key购买 nike

我有以下蜡烛

+----------------+-------+----------+---------+----------+
|date |curency|high_price|low_price|last_price|
+----------------+-------+----------+---------+----------+
|2014-01-16 16:07|2 |24.98 |23.9 |24.2 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:06|2 |24.98 |23.9 |24.12202 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:05|2 |24.98 |23.9 |24.12202 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:04|2 |24.98 |23.9 |24.21626 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:03|2 |24.98 |23.9 |24.11102 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:02|2 |24.98 |23.9 |24.21628 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:01|2 |24.98 |23.9 |24.2 |
+----------------+-------+----------+---------+----------+
|2014-01-16 16:00|2 |24.98 |23.9 |24.2 |
+----------------+-------+----------+---------+----------+

我使用 TA-lib 来计算 Ema,如下

public MovingAverage CalculateEMA(List<OHLC> candles, int periodsAverage)
{
double[] closePrice = candles.Select(x => (double)x.last_price).ToArray();
double[] output = new double[closePrice.Length];
int begin;
int length;

TicTacTec.TA.Library.Core.RetCode retCode = Core.Ema(0, closePrice.Length - 1, closePrice, periodsAverage, out begin, out length, output);

if (retCode == TicTacTec.TA.Library.Core.RetCode.Success)
return new MovingAverage() { Begin = begin, Length = length, Output = output, Period = periodsAverage };

return null;
}

问题是,以最近的入场点为顶部或底部的正确蜡烛顺序是什么?图书馆如何进行计算?在计算 Ema 之前我应该​​反转蜡烛列表吗?我对macd计算也有同样的问题

谢谢,

最佳答案

最早的日期/时间是数组中的第一个元素 - element[0]。时间顺序=数组顺序。您最近的时间(最后一次)应该是数组中的最后一个元素。
此逻辑适用于所有 TA-Lib 函数。

关于c# - ta-lib计算的数据顺序是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21260647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com