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

Questions about MultiCharts .NET and user contributed studies.
Emmanuel
Posts: 303
Joined: 21 May 2009
Has thanked: 83 times
Been thanked: 22 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
CaptureA4.JPG (84.43 KiB) Viewed 991 times
CaptureA3.JPG
CaptureA3.JPG (71.54 KiB) Viewed 982 times
CaptureA2.JPG
CaptureA2.JPG (88.27 KiB) Viewed 962 times
CaptureA1.JPG
CaptureA1.JPG (83.01 KiB) Viewed 954 times

Emmanuel
Posts: 303
Joined: 21 May 2009
Has thanked: 83 times
Been thanked: 22 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
CaptureSignal.JPG (31.37 KiB) Viewed 970 times
CaptureIndicateur.JPG
CaptureIndicateur.JPG (31.62 KiB) Viewed 974 times

Emmanuel
Posts: 303
Joined: 21 May 2009
Has thanked: 83 times
Been thanked: 22 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
Capture Signal.JPG (68.52 KiB) Viewed 968 times
Capture Indicator.JPG
Capture Indicator.JPG (67.05 KiB) Viewed 972 times

User avatar
Henry MultiСharts
Posts: 9092
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 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: 303
Joined: 21 May 2009
Has thanked: 83 times
Been thanked: 22 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”