Same code and inputs between MultiCharts and TS, different outputs

Questions about MultiCharts and user contributed studies.
tonyt
Posts: 48
Joined: 21 May 2021
Has thanked: 20 times
Been thanked: 1 time

Same code and inputs between MultiCharts and TS, different outputs

Postby tonyt » 25 Feb 2022

Hello,

I have the Same CCI Indicator & Function, so far as I can tell, same inputs definitely, yet different outputs / trades between TS, which is live, and Multicharts which is the development desktop. When I compare the code between the functions and indicators, the MultiCharts code appears to be copied directly from TS, using generic variables, instead of naming them:

Here's MultiCharts:

Code: Select all

inputs: Len( numericsimple ) ; variables: var0( 0 ), var1( 0 ), var2( 0 ) ; var0 = Average( H + L + C, Len ) ; var1 = 0 ; for var2 = 0 to Len - 1 begin var1 = var1 + AbsValue( ( H + L + C )[var2] - var0 ) ; end ; var1 = var1 / Len ; if var1 = 0 then CCI = 0 else CCI = ( H + L + C - var0 ) / ( .015 * var1 ) ;
Here's TS

Code: Select all

{ Search Tag: WA-CCI } { Commodity Channel Index } inputs: Length( numericsimple ) ; { will get divide-by-zero error if Length = 0 } variables: Mean( 0 ), AvgDev( 0 ), Counter( 0 ) ; Mean = Average( H + L + C, Length ) ; { don't have to divide H+L+C by 3, cancels out } AvgDev = 0 ; for Counter = 0 to Length - 1 begin AvgDev = AvgDev + AbsValue( ( H + L + C )[Counter] - Mean ) ; end ; AvgDev = AvgDev / Length ; if AvgDev = 0 then CCI = 0 else CCI = ( H + L + C - Mean ) / ( .015 * AvgDev ) ;
Since the CCI Average indicator is built off the CCI function this should be where the discrepancy lies correct?

let me know your thoughts, thank you. Makes me wonder if the subtle differences between the two platforms will create issues like this going forward of if it's addressable with code changes.
Attachments
MultiCharts CCI Interpretation.png
(13.18 KiB) Not downloaded yet
TS CCI Interpretation - Copy.png
(26.21 KiB) Not downloaded yet

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

Re: Same code and inputs between MultiCharts and TS, different outputs

Postby TJ » 25 Feb 2022

GIGO

Your MC data is different.
See the LONG bar at the beginning of the day.

tonyt
Posts: 48
Joined: 21 May 2021
Has thanked: 20 times
Been thanked: 1 time

Re: Same code and inputs between MultiCharts and TS, different outputs

Postby tonyt » 25 Feb 2022

GIGO

Your MC data is different.
See the LONG bar at the beginning of the day.
I see that now thank you! I'll delete the data and cache and see if that helps.

tonyt
Posts: 48
Joined: 21 May 2021
Has thanked: 20 times
Been thanked: 1 time

Re: Same code and inputs between MultiCharts and TS, different outputs

Postby tonyt » 25 Feb 2022

GIGO

Your MC data is different.
See the LONG bar at the beginning of the day.
TJ in your experience, what typically causes these data discrepancies? Especially given that the data in both charts is from TS.

Thank you

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

Re: Same code and inputs between MultiCharts and TS, different outputs

Postby TJ » 25 Feb 2022

That's difficult to say . . . it could be one of a million things.

Maybe one chart is 24 hrs and the other is RTH?
or a rollover of a continuous contract? One is back adjusted but the other is not?


Return to “MultiCharts”