MACD on Data2 not replicating on Data1

Questions about MultiCharts and user contributed studies.
AdrianP
Posts: 46
Joined: 02 Sep 2014
Has thanked: 2 times
Been thanked: 1 time

MACD on Data2 not replicating on Data1

Postby AdrianP » 22 Sep 2020

Hi,

Can someone explain please why my MACD values used in my system code (see below) plotted on Data1 using Data2, does not even come close to being the same values, and why the MACD(Data2) values change every bar on Data1. Clearly this is completely wrong, as the value should be the same every bar on Data1 until Data2 value changes.

I am using Renko bars, with Data2 being a multiple of bar size of Data1. The ratio is irrelevant.

The formula used in my system code to calculate and plot is the exact same MC used for their MACD formula.
Var1 = MACD( Close of Data2, 12, 26);

When I plot a chart plot of MACD referencing Data2, the values align perfectly to a separate chart using the same Data2 values. So all good.
The times align for each value.

But using the exact same formula in my code, and referencing data2, I get completely different numbers, and they change EVERY Data1 bar. Which should be IMPOSSIBLE.

What have I missed here?

And no TJ, I don't need to supply more code or a chart.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: MACD on Data2 not replicating on Data1

Postby TJ » 22 Sep 2020

Hi,
. . .

And no TJ, I don't need to supply more code or a chart.
I am not the one who needs help.

You should read my FAQ/

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: MACD on Data2 not replicating on Data1

Postby JoshM » 23 Sep 2020

And no TJ, I don't need to supply more code or a chart.
It can be quite frustrating to deal with platform problems, but I think a chart picture would help. I rarely use Renko charts so I don't have a good visual picture in my mind of what you're talking about.

AdrianP
Posts: 46
Joined: 02 Sep 2014
Has thanked: 2 times
Been thanked: 1 time

Re: MACD on Data2 not replicating on Data1

Postby AdrianP » 23 Sep 2020

Hi Josh,

To correct my initial post, I was referring to FLEX RENKO. I haven't tested if the problem is also present on regular renko bars.
And the reason I didn't post a chart is because it is NOT a visual or chart problem. It is a MATH problem, and a MC coding problem in aligning 2 different data stream bars. So a chart would be utterly useless, even though other 'regular' posters might try to make you think otherwise.

So, don't think visually, think mathematically :) I appreciate my explanation might not have been totally clear. I have emailed support, and they know 100% what I'm talking about, and don't need a chart nor code. I honestly don't think it is solvable on our side, but a core MC issue of data stream alignment.


Return to “MultiCharts”