I would like to export the swing highs/lows of the ZigZag indicators. When I add it to the chart and say File->Export the indicator values are not exported with the Instrument data.
Is there a way to export this indicator data, or does the indicator need to be modified to enable this function?
Thanks
ZigZag Data Export [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export
Hello bryanzim,
In order to be able to export study values-your study should be calculated and results should be plotted on your chart. Study code requires no changes to utilize this feature.
Please make sure you have study plots on the chart and the option "Export values for indicators based on symbol" in File->Export Data is checked.
In order to be able to export study values-your study should be calculated and results should be plotted on your chart. Study code requires no changes to utilize this feature.
Please make sure you have study plots on the chart and the option "Export values for indicators based on symbol" in File->Export Data is checked.
Re: ZigZag Data Export
Dear Henry,
The indicator was added to the chart and showed the appropriate lines indicating it was functioning. I also had the "Export values for indicators based on symbol" checked. However all the was exported in the CSV file was the instrument data, i.e. Date, Time, High, Low, Close, Volume but no indicator values.
FYI, I was using the ZigZagPnts indicator.
Thanks,
Bryan Z
The indicator was added to the chart and showed the appropriate lines indicating it was functioning. I also had the "Export values for indicators based on symbol" checked. However all the was exported in the CSV file was the instrument data, i.e. Date, Time, High, Low, Close, Volume but no indicator values.
FYI, I was using the ZigZagPnts indicator.
Thanks,
Bryan Z
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export
bryanzim,
Please replicate this behavior with one of the prebuilt indicators.
Attach the workspace you are using.
Specify the version and build number of MultiCharts are you using (Help -> About MultiCharts).
Please replicate this behavior with one of the prebuilt indicators.
Attach the workspace you are using.
Specify the version and build number of MultiCharts are you using (Help -> About MultiCharts).
Re: ZigZag Data Export
The attached workspace file contains the YM# chart with two indicators, the moveing average 1 and the zigzag_pnts. I also included what is exported by turning each indicator on.
I am using Multicharts.NET 64 V8.5.6862
Thanks
I am using Multicharts.NET 64 V8.5.6862
Thanks
- Attachments
-
- Desktop.zip
- (42.95 KiB) Downloaded 343 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export
bryanzim,
zigzag_pnts indicator creates trendlines on the chart. Trendline values are not written into the text file when you go to File->Export data. Only plots are written with this feature.
You can use File class to write out the values you need into a text file. Here is "How to" guide.
zigzag_pnts indicator creates trendlines on the chart. Trendline values are not written into the text file when you go to File->Export data. Only plots are written with this feature.
You can use File class to write out the values you need into a text file. Here is "How to" guide.
Re: ZigZag Data Export
I was able to get the data to export but ran into a peculiar problem.
If I wrote the code in CalcBar() as follows
It would work.
But if I wrote CalcBar() by splitting up the operations such as
I would get exceptions that the file was opened in another process. Is this expected or does some special locking need to be implemented.
Thanks
If I wrote the code in CalcBar() as follows
Code: Select all
if (OutputTextFile != null)
{
StreamWriter swFile = new StreamWriter(OutputTextFile, true);
swFile.WriteLine(m_swingtime[1] + "," + m_swingprice[1]);
swFile.Close();
}
But if I wrote CalcBar() by splitting up the operations such as
Code: Select all
StreamWriter swFile=null;
if (OutputTextFile != null)
{
swFile = new StreamWriter(OutputTextFile, true);
}
...
if (OutputTextFile != null)
{
swFile.WriteLine(m_swingtime[1] + "," + m_swingprice[1]);
swFile.Close();
}
Thanks
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export
Hello bryanzim,I was able to get the data to export but ran into a peculiar problem.
If I wrote the code in CalcBar() as follows
It would work.Code: Select all
if (OutputTextFile != null)
{
StreamWriter swFile = new StreamWriter(OutputTextFile, true);
swFile.WriteLine(m_swingtime[1] + "," + m_swingprice[1]);
swFile.Close();
}
But if I wrote CalcBar() by splitting up the operations such as
I would get exceptions that the file was opened in another process. Is this expected or does some special locking need to be implemented.Code: Select all
StreamWriter swFile=null;
if (OutputTextFile != null)
{
swFile = new StreamWriter(OutputTextFile, true);
}
...
if (OutputTextFile != null)
{
swFile.WriteLine(m_swingtime[1] + "," + m_swingprice[1]);
swFile.Close();
}
Thanks
Do you have this problem during optimization process?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export
bryanzim, please change your code condition from
to:
Code: Select all
if (OutputTextFile != null)
{ ... }
Code: Select all
if (swFile != null)
{ .... }
Re: ZigZag Data Export
Here is the indicator changed as requested as well as the error produced if the file is not closed after each access.
Thanks
Thanks
- Attachments
-
- Desktop.zip
- (133.11 KiB) Downloaded 323 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: ZigZag Data Export [SOLVED]
Hello bryanzim,
Please find the code fixed by our developer attached.
Please find the code fixed by our developer attached.
- Attachments
-
- ZigZag_Export_Pnts.pln
- (2.06 KiB) Downloaded 719 times