TulipCharts / tulipindicators

Technical Analysis Indicator Function Library in C
https://tulipindicators.org/
GNU Lesser General Public License v3.0
818 stars 154 forks source link

How can I support append calculations? #125

Open zhixiongdu027 opened 12 months ago

zhixiongdu027 commented 12 months ago

For instance, given the existing data stream:

{81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55};

I calculated the MACD (Moving Average Convergence Divergence) values to be:

{0.618,0.351,0.111,0.416,0.578}
{0.618,0.564,0.474,0.462,0.485}
{0.000,-0.213,-0.363,-0.046,0.093}

Then, I appended two data point to the queue: {84.36,85.53}.

The expected result was:

{0.618,0.351,0.111,0.416,0.578 ,              0.422,0.684   }
{0.618,0.564,0.474,0.462,0.485,                0.473,0.515  }
{0.000,-0.213,-0.363,-0.046,0.093,             -0.050,0.169  }

However, the actual calculation did not yield these results. Could someone please help me understand what might be going wrong?

@yageek @codeplea @cschanaj

codeplea commented 12 months ago

Without seeing your code, its impossible to know where you're going wrong.