|
Different source code |
Posted by Sherlock on Aug-28-2012 14:11 |
|
Hi,Experts
I checked the visiul c and VB.net example code. There are different between this two language.For example,in VB, there is just a declare for addMACD,but in vc, we can get a class/fuction as following. So my question is ,can we get more details controll if use vc language?? Thanks in advance.
Looking forward your response.
/*****
public: XYChart* addMACD(int height, int period1, int period2, int period3, int color,
int signalColor, int divColor)
{
XYChart *c = addIndicator(height);
char buffer[1024];
//MACD is defined as the difference between two exponential averages (typically 12/26 days)
ArrayMath expAvg1 = ArrayMath(m_closeData).expAvg(2.0 / (period1 + 1));
ArrayMath macd = ArrayMath(m_closeData).expAvg(2.0 / (period2 + 1)).sub(expAvg1);
//Add the MACD line
sprintf(buffer, "MACD (%d, %d)", period1, period2);
addLineIndicator2(c, macd, color, buffer);
//MACD signal line
ArrayMath macdSignal = ArrayMath(macd).expAvg(2.0 / (period3 + 1));
sprintf(buffer, "EXP (%d)", period3);
addLineIndicator2(c, macdSignal, signalColor, buffer); |
Re: Different source code |
Posted by Peter Kwan on Aug-28-2012 18:53 |
|
Hi Sherlock,
Both "ChartDirector for C++" and "ChartDirector for .NET" contains the source code for the FinanceChart object.
In C++, you need to use header files, so the FinanceChart is simply implemented in the header file "FinanceChart.h" and released in source.
In .NET, there is no such thing as header file, and everything you "Import" must be compiled code. So there is a compiled version of FinanceChart included in the ChartDirector .NET assembly. However, we also include the source code version in "ChartDirector\\NetFinanceChart" subdirectory. Please refer to the ChartDirector for .NET documentation for details (you may look up for "FinanceChart" from the ChartDirector documentation index - it leads to a page that mentions where is the source code and how to use it).
Note that in ChartDirector for .NET, the source code is in C#. It is because .NET can support many languages (C#, VB.NET, C++/CLI and a large number of other languages). It is not necessary of practical to translate the same source code to all possible .NET language. So we just choose C#. After compiling the source code, you can freely used the resulting compiled code in a VB.NET project or any other .NET project.
So in summary, you can get the same level of control no matter you are using C++ or .NET.
Hope this can help.
Regards
Peter Kwan |
Re: Different source code |
Posted by Sherlock on Aug-29-2012 13:23 |
|
Hi,
Thanks you details nice answer.
But in c# I just get :
//
// 摘要:
// Adds a MACD indicator chart.
//
// 参数:
// height:
// The height of the indicator chart in pixels.
//
// period1:
// The first moving average period to compute the indicator.
//
// period2:
// The second moving average period to compute the indicator.
//
// period3:
// The moving average period of the signal line.
//
// color:
// The color of the indicator line.
//
// signalColor:
// The color of the signal line.
//
// divColor:
// The color of the divergent bars.
public XYChart addMACD(int height, int period1, int period2, int period3, int color, int signalColor, int divColor);
This is just a simple claim about addMACD .
br,lt |
Re: Different source code |
Posted by Sherlock on Aug-29-2012 22:17 |
|
And after extracted installation zip file, I just have
ChartDirector\\NetWebCharts:
ChartDirector\\NetWinCharts:
ChartDirector\\signed:
ChartDirector\\doc
directory only, not including "[ChartDirector]\\NetFinanceChart" directory.
br,lt.Sherlock |
Re: Different source code |
Posted by Sherlock on Aug-29-2012 22:21 |
|
BTW, the version used is .NET |
Re: Different source code |
Posted by Peter Kwan on Aug-30-2012 00:03 |
|
Hi Sherlock,
Sorry for this problem. It is our mistaken.
I have just double checked the "ChartDirector for .NET" distribution, and found that it has no "NetFinanceChart". We had forgot to include it in the ChartDirector for .NET Ver 5.1 distribution.
I have just updated the "ChartDirector for .NET" distribution to include the "NetFinanceChart". Please download it from our web site one more time. It should now has the "NetFinanceChart" subdirectory.
Hope this can solve the problem.
Regards
Peter Kwan |
Re: Different source code |
Posted by Sherlock on Aug-30-2012 08:33 |
|
Hi,Kwan
That's great. I will try later.
br,Sherlock |
|