Replace N/A bars with last known price?
Replace N/A bars with last known price?
I'm doing a lot of correlation/spread trading, and use data series overlapping in one chart to spot these. The problem is that in very calm markets, on lower timeframes, there might not be a tick at that certain bar. Multicharts show this as an N/A bar in that case, which messes up the indicators as well. And if the indicator is attached to one symbol, it will show gaps in the indicator just as in the market it is attached to (where the gap is simply no ticks traded that bar even if the market is open). I've been looking for solutions to this but not yet found one - I can understand the gap if the market is closed, but it must be possible somehow to get a plot for every bar when the market is open?
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Replace N/A bars with last known price?
You can plot anything you want on the chart.I'm doing a lot of correlation/spread trading, and use data series overlapping in one chart to spot these. The problem is that in very calm markets, on lower timeframes, there might not be a tick at that certain bar. Multicharts show this as an N/A bar in that case, which messes up the indicators as well. And if the indicator is attached to one symbol, it will show gaps in the indicator just as in the market it is attached to (where the gap is simply no ticks traded that bar even if the market is open). I've been looking for solutions to this but not yet found one - I can understand the gap if the market is closed, but it must be possible somehow to get a plot for every bar when the market is open?
You can create an indicator to plot the last known close if there is none.
Re: Replace N/A bars with last known price?
It seems like you misunderstood my question. Let's say you plot two instruments on one chart, such as SPI and Aussie Dollar. During low volume times, it might be that no ticks are made in one of them, and on a 1m chart it will leave this bar as a whole, instead of making a print of the old price. Applying an indicator to this means the indicator will show a gap for this bar as well, which is what I'm trying to avoid.
Cheers.
Cheers.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Replace N/A bars with last known price?
Sure, you can plot the last known price in the gap; that's exactly what I meant. Unless you want something else, please make a mock up chart to illustrate your vision.It seems like you misunderstood my question. Let's say you plot two instruments on one chart, such as SPI and Aussie Dollar. During low volume times, it might be that no ticks are made in one of them, and on a 1m chart it will leave this bar as a whole, instead of making a print of the old price. Applying an indicator to this means the indicator will show a gap for this bar as well, which is what I'm trying to avoid.
Cheers.
Re: Replace N/A bars with last known price?
To better understand your need, and to emphasis TG response, I suggest you to take a screen picture, and explain what is your problem and what you want to achieved.I'm doing a lot of correlation/spread trading, and use data series overlapping in one chart to spot these. The problem is that in very calm markets, on lower timeframes, there might not be a tick at that certain bar. Multicharts show this as an N/A bar in that case, which messes up the indicators as well. And if the indicator is attached to one symbol, it will show gaps in the indicator just as in the market it is attached to (where the gap is simply no ticks traded that bar even if the market is open). I've been looking for solutions to this but not yet found one - I can understand the gap if the market is closed, but it must be possible somehow to get a plot for every bar when the market is open?
If you want to have a value other than N/A, your plot value should not be attached to a calculation but to a variable relate to it
If condition = True then Variable = indicator computation;
Plot variable;
Variable will have a new value each time your indicator is valid and it will remain the same when Indicator is not valid
Don't forget to define your variable as Intrabarpersist. This way the value will be persistent for each bar
Martin
Re: Replace N/A bars with last known price?
Thanks for the ideas, I solved it by overlaying the data with an indicator keeping track of the last value instead and referred to this to get the price instead of the instrument. Not the best solution but will do for now.
Re: Replace N/A bars with last known price?
I'm now back to this problem since I'm past the first solution and it doesn't do what I now need to do now.
Again, the problem is to plot an indicator when a bar (or more) is missing in a datafeed. Please take a look at the attached image showing Aussiedollar future and the spot market. The aussie dollar is closed for one hour, but I still need to show information in this chart. However attaching an indicator to the Aussie dollar (top) chart means I get N/A values when the Aussie dollar future bars are missing.
I could use the spot market (bottom)to plot the data for the Aussie dollar instead, since this market still trades when Aussie dollar is close, but this generates a scaling problem if I want to plot the indicator in the top chart. If I chose "same as symbol" it uses the spot market scale since the indicator is attached to this data series to plot all the time, even if I use another data series inside the indicator.
I've added two indicators (close price and moving average) of the Aussie dollar to show that it looks like it's plotting, but the data window show that it's a N/A value for both.
Any ideas of how this can be solved? I can base it on the spot market if there is a way to control the price scale better...
In short - I need to have an indicator plot during N/A bars with the correct price scale..
Again, the problem is to plot an indicator when a bar (or more) is missing in a datafeed. Please take a look at the attached image showing Aussiedollar future and the spot market. The aussie dollar is closed for one hour, but I still need to show information in this chart. However attaching an indicator to the Aussie dollar (top) chart means I get N/A values when the Aussie dollar future bars are missing.
I could use the spot market (bottom)to plot the data for the Aussie dollar instead, since this market still trades when Aussie dollar is close, but this generates a scaling problem if I want to plot the indicator in the top chart. If I chose "same as symbol" it uses the spot market scale since the indicator is attached to this data series to plot all the time, even if I use another data series inside the indicator.
I've added two indicators (close price and moving average) of the Aussie dollar to show that it looks like it's plotting, but the data window show that it's a N/A value for both.
Any ideas of how this can be solved? I can base it on the spot market if there is a way to control the price scale better...
In short - I need to have an indicator plot during N/A bars with the correct price scale..
- Attachments
-
- Screenshot.png
- (83.63 KiB) Downloaded 451 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Replace N/A bars with last known price?
you can capture the premium/discount of the future/cash at the time the future closed,
then use the prem/disc to fudge the indicator.
then use the prem/disc to fudge the indicator.