Plotting Text...

Questions about MultiCharts and user contributed studies.
Graham
Posts: 4
Joined: 31 Oct 2012

Plotting Text...

Postby Graham » 31 Oct 2012

I'm hoping this is going to be straightforward.

I use the WeisWave in my intraday trading, for those unfamiliar a description can be found on David Weis' website.

The indicator is available for various platforms, TS, NT etc. These platforms have the ability to plot the total cumlative volume on the chart at the wave turning points. Sadly, this option is not available on the Multicharts version. Having spoken to David he was advised by his programmer that this wasn't possible with the MC version.

The question I have is whether it's possible to create a new indicator that references the output of the weiswave and plots the volume count as text on the chart.

I'm hoping the picture I've included helps explain this a little clearer. At Point A we've had a wave that has taken price from 1408 to 1417, each bar is 1000 ticks (or whatever timeframe you choose) the volume on each bar is added to the previous bar until the price changes direction according to the wave settings, in the example 0.75 points. As you can see from the information box, this information is calculated under "SumVol". I'd also like to be able to change the text value to display a short value, so say 110,000 contracts was the cumlatative volume, i'd like to display that as 110.

The indicator supplied for the weiswave is password protected.

Many thanks in advance.
Graham
Attachments
WEISWAVE.png
(126.16 KiB) Downloaded 528 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Plotting Text...

Postby Henry MultiСharts » 31 Oct 2012

Hello Graham,

An indicator cannot be applied to an indicator directly.
If you want to apply an indicator to another indicator you need to place both indicators into one study in order to perform the calculation based on original indicator values. You can also create the function that will do the calculation you need and then reference it from your code.

So in your particular case the final goal can be achieved only if the desired value is calculated by a function and you know the function's name. Then you can reference this function from your own indicator.

I don't know what is the particular difficulty this study developers have, but there is a number of operations you can perform with the text in PowerLanguage. If they need to plot the text on the indicator series then they can use text_new_self. They can contact us directly if they have a different issue that they are unable to resolve.

Graham
Posts: 4
Joined: 31 Oct 2012

Re: Plotting Text...

Postby Graham » 01 Nov 2012

Thanks Henry,
I've managed to work out how the "SumVol" is calculated and then reset when the swing changes direction.

Another issue I have is with the Volume plotting. For example, is the retrace value is set to 0.75 of a point, the wave and volume change direction if the bar closes 0.75 or greater than the previous bar, a new wave is then formed.

However, if price moves intrabar 0.75 or greater but doesn't close 0.75 or greater, i.e the retrace condition is false (as it's based on closes) the volume starts to plot in the color of a new wave direction. If I turn the status of the indicator off and back on again the volume is plotted correctly. I'll post a picture when this happens again.

In laymans terms it's as though the code is believing the conditons are correct for a change in direction when in actual fact it's not.

Graham
Posts: 4
Joined: 31 Oct 2012

Re: Plotting Text...

Postby Graham » 01 Nov 2012

I knew it wouldn't take long to appear.

Price reverses at point A, with the bar close (yellow line) greater than the wave retrace of 0.75 points. The volume starts a new plot in green. The bar closes at 1403.00

The next bar drops to 1401.75 but closes at 1402.50, 0.50 of a point close from the previous bar, therefore the retrace value is false, but the volume has been painted red.

It's as though the indicator senses price has gone through the retrace value and paints the color but is not recalculating itself when the bar closes. As you can see the remaining bars dont move intrabar more than 0.75 in the opposite direction so the volume plots correctly.
Attachments
VOL.png
(29.8 KiB) Downloaded 497 times

Graham
Posts: 4
Joined: 31 Oct 2012

Re: Plotting Text...

Postby Graham » 01 Nov 2012

Just as an update to this incorrect plotting....

The "SumVol" calculation is correct in that the total volume for the wave is correct regardless of the color it's painted. So in the example above, although a down wave volume has been plotted the upwave volume is correct when that upwave finishes, in that it is counting the down vol in it's total as the price price hasn't reversed.

So the issue is in fact redrawing the plot of n previous bars after the latest bar has finished.

The code for drawing the SumVol is this....

Code: Select all

if Top then begin
SumVol = 0;
Color = DnColor;
for j = TBar-1 downto 0 begin
SumVol = SumVol + MV[j];
Plot1[j](SumVol, "SumVol", DnColor);
end;
end else
if Bot then begin
SumVol = 0;
Color = UpColor;
for j = BBar-1 downto 0 begin
SumVol = SumVol + MV[j];
Plot1[j](SumVol, "SumVol", UpColor);

Question: is there a simple routine that could be added to verify and redraw the plot prior to the current bar?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Plotting Text...

Postby Henry MultiСharts » 01 Nov 2012

Please create a funсtional sample of your code that will demonstrate the described behavior. Export it from PowerLanguage Editor (File->Export->Check "With dependent functions") and attach here.


Return to “MultiCharts”