Quick question: bug or feature ?

Spin

Well-known member
Joined
May 22, 2019
Posts
478
Likes
191
I am working on a project for a client.

I noticed that from the moment I add a secondary plot (some sort of Oscillator in the example below), the Study's name is repeated twice in the top left of the main window:

1627405074379.png

No matter what I try in the StudyHeader, or in 'Initialize', I cannot get rid of that repetition of the name.

Has anyone figured out yet why the name is repeated and how to get rid of the second occurrence ?

A single instance of the Study's name would be some much easier on the eyes :)

Thanks in advance for all the hints !
 

Dragon

Member
Joined
Aug 6, 2021
Posts
5
Likes
0
Certainly some sort of bug in the indicator or MW. No matter how many plots I create and add to a Study, this does not occur.
 

ScottyA

Well-known member
Joined
Aug 1, 2019
Posts
272
Likes
183
That's wild bro! I haven't had that happen in any of my work.

I wondered a bit ago what changed for custom Studies when MW updated to 6.3.1, adding the Study Quick Editor/Tool Bar and tweaked the SDK.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
478
Likes
191
Thanks @Dragon & @ScottyA for your replies.

I investigated deeper and my findings are, eeeerm, inconsistent. I have been fiddling with the StudyHeader and with the label I plot.
This is the 'normal' situation, with these settings in the Header:
Java:
overlay=true,
studyOverlay=true,
1629266397457.png

Study's name pops up twice, and label is plotted on the Plot.PRICE.

I then removed the label ("HTF"), the secondary plot (the AOscillator) and changed the StudyHeader settings to this:
Java:
overlay=false,
studyOverlay=false,

That resulted in this:

1629267526951.png

So that's progress, of some sorts: I believe a(n empty) secondary plot is still printed, because the Study is not being overlaid on the default (price) plot.

So then I thought: ok, let's overlay it again, and the name will show up only once. But nope, enter the second instance of the Study's name again:
Java:
overlay=true,
studyOverlay=false,

1629267784781.png

The inverse, by the way, has this effect:
Java:
 overlay=false,
 studyOverlay=true,
1629267975629.png

I have run out of options here. There must be 'something' quirky about my code, but I cannot seem to put my finger on it.
I removed all references to the label and all code connected to the secondary plot, so this "skeleton"-Study now basically prints 2 lines on the pricePlot.

I will be very grateful for suggestions on how to tackle this further :D
 

MotiveWave_Joe

Moderator
Staff member
Joined
Mar 26, 2019
Posts
223
Likes
67
Hi Spin,

Perhaps there is something specific to your code that is triggering the second label. Are you able to trigger the issue using any of our built in studies by changing the values in the StudyHeader?

I wasn't able to reproduce the issue with any of our built in studies. Here are the studies I tried. Note their overlay and studyOverlay settings:

DEMA - overlay=true studyOverlay=true
ATR - overlay=false, studyOverlay=true
OHLC - overlay=true, studyOverlay=false
 

Spin

Well-known member
Joined
May 22, 2019
Posts
478
Likes
191
For the record: I have finally figured this out :)

I was doing things with "desc." and the addition of extra plots (in initialize) that the SDK didn't like.

This should not be present:
Java:
 Plot aoPlot = new Plot();
 desc.addPlot(AO_PLOT, aoPlot);

This suffises:
Java:
desc.setLabelPrefix("Awesome Osc");
    desc.setTabName("Awesome Osc");
    desc.declarePath(Values.AWE_SIGNAL, SIGNAL_PATH);
    desc.declareBars(Values.AWE_OSC);
    desc.declareIndicator(Values.AWE_SIGNAL, SIGNAL_IND);
    desc.declareIndicator(Values.AWE_OSC, AWE_IND);
    desc.setRangeKeys(Values.AWE_OSC, Values.AWE_SIGNAL);
    desc.addHorizontalLine(new LineInfo(0, null, 1.0f, new float[] {3,3}));




Additionally, I had to set both overlay and studyOverlay to ' false', and all is well now. Yay !

It seems that every time you add a 'Plot', the Study's name is written an extra time (when overlays are true, that is) :geek:
 
Top