Can we have access to the code of the function ?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Can we have access to the code of the function ?

Postby Emmanuel » 11 Mar 2013

Hi,

I am using Mov_Avg_1_Line indicator,

I check results of the AverageFC function, I found some annoying difference number in my code :

The best way to see it is to make an average of 1 bars:

As you can know it is an average of the last close bar.

We should find as the results, Average bar.close = close , but the result is different as you can see on the capture results.

Can we have access to the code of the function ?

Would it be possible to fix the function ?


(we don't have access to the source code of the function)

Emmanuel
Attachments
CaptureA4.JPG
(84.43 KiB) Downloaded 1024 times
CaptureA3.JPG
(71.54 KiB) Downloaded 1015 times
CaptureA2.JPG
(88.27 KiB) Downloaded 995 times
CaptureA1.JPG
(83.01 KiB) Downloaded 987 times

Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Re: Can we have access to the code of the function ?

Postby Emmanuel » 11 Mar 2013

Hi


I found a difference of results between a signal and an indicator for the same function : AverageFC

See the attached files : at the last line : VAR2(1) : AverageFC

Why a difference of results between a signal and an indicator ?

If we have access to the source code, we will able to find the reason.

Emmanuel
Attachments
CaptureSignal.JPG
(31.37 KiB) Downloaded 1003 times
CaptureIndicateur.JPG
(31.62 KiB) Downloaded 1007 times

Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Why the results between signal and indicator different ?

Postby Emmanuel » 13 Mar 2013

Hi

Why are the results between a signal and an indicator different for the same function ?

For exemple :

if we use AverageFC as an indicator then as a signal, the results are a little bit different

In the attached file, you can see the AverageFC, is represented by Var3(0)

(I get the some difference with Mov Average Adaptive as well Var3(3))

The Close Var1(3) is the same for the signal and indicator , so why the results are different ?

Emmanuel
Attachments
Capture Signal.JPG
(68.52 KiB) Downloaded 1001 times
Capture Indicator.JPG
(67.05 KiB) Downloaded 1005 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Can we have access to the code of the function ?  [SOLVED]

Postby Henry MultiСharts » 14 Mar 2013

Hello Emmanuel,

this.Bars.Close return the price value according to the price scale of your chart.
m_avg.Value returns the calculated average value using double values.
In math the following expression is always true A == ( A / B ) * B, but when you use double values for calculation the expression can be no longer true (the price difference you have shown on your screenshots). To learn more about Double class values peculiarities please refer to this page for more details.
If you round the m_avg.Value to the amount of digits after decimal you have for your instrument then m_avg.Value will be equal to this.Bars.Close.

AverageFC function source code is available in PowerLanguage .Net Editor in MultiCharts 8.5

Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Re: Can we have access to the code of the function ?

Postby Emmanuel » 15 Mar 2013

Hello Henry,

I didn't know this
this.Bars.Close return the price value according to the price scale of your chart.
m_avg.Value returns the calculated average value using double values.
In math the following expression is always true A == ( A / B ) * B
Thank you very much for this link, I knew about this Epsilon, but it is the first time I see
a clear explaination about it. Thank you very much for giving this link , Now I understand clearly.

:) We have access to the functions this Awesome !!! :)

This is really usefull !!!, I am really impress by the udge improvement Multicharts team bring each time.


Return to “MultiCharts .NET”