Hi,
When using multiple dataseries......
Was just wondering if there was a keyword to check for presence of data2,3,4 etc on a chart.
E.g. If data2=not present then xyz
Many thanks!
Is there a keyword for checking if a data series is present? [SOLVED]
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: Is there a keyword for checking if a data series is pres [SOLVED]
I believe that if you try to apply a signal that uses multiple data series on a chart that does not have multiple data series, you will get an error right off the bat. In other words, your code won't run.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Is there a keyword for checking if a data series is pres
It would be helpful, I think, if there is a PowerLanguage keyword that returns the number of data series on the current chart:I believe that if you try to apply a signal that uses multiple data series on a chart that does not have multiple data series, you will get an error right off the bat. In other words, your code won't run.
Feature request - MC-1779 - Keyword that returns the number of data series
That would enable us to prevent these errors programmatically so that the code can keep running.
Re: Is there a keyword for checking if a data series is pres
I've run into this again.
For example:
If I have 10 different contracts on 1 chart and wanted to total up the volume across all contracts......
but
if, say 1 contract is blank (no price/volume prints) for a certain time period, then the indicator doesn't plot, until all contracts used in the indicator have data points present.
My question is.....
how do I get the indicator to keep summing up the volume bar after bar even when one just data series has gaps/ hasn't started yet? Is this something I can add to the code? "If data1 is present" then xyz etc etc.
Thanks.
For example:
If I have 10 different contracts on 1 chart and wanted to total up the volume across all contracts......
but
if, say 1 contract is blank (no price/volume prints) for a certain time period, then the indicator doesn't plot, until all contracts used in the indicator have data points present.
My question is.....
how do I get the indicator to keep summing up the volume bar after bar even when one just data series has gaps/ hasn't started yet? Is this something I can add to the code? "If data1 is present" then xyz etc etc.
Thanks.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Is there a keyword for checking if a data series is pres
Hello wilkinsw,I've run into this again.
For example:
If I have 10 different contracts on 1 chart and wanted to total up the volume across all contracts......
but
if, say 1 contract is blank (no price/volume prints) for a certain time period, then the indicator doesn't plot, until all contracts used in the indicator have data points present.
My question is.....
how do I get the indicator to keep summing up the volume bar after bar even when one just data series has gaps/ hasn't started yet? Is this something I can add to the code? "If data1 is present" then xyz etc etc.
Thanks.
The main thing is to have the bars on the data series that is selected in "Base Data #" of indicator, as they trigger the code calculation. For additional data series if bars are missing the code utilizes the data values according to the Realtime-History Matching option.