Indicator scaling when based on hidden data

Questions about MultiCharts .NET and user contributed studies.
MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Indicator scaling when based on hidden data

Postby MidKnight » 04 Dec 2013

Hi there,

I have a chart with one data series that is minute based and another data series of the same instrument that is based on 1 tick data. I want to have the 1 tick data hidden and base and indicator off this. This seems to create problems with bar spacing of my minute based chart and the indicator does not seem to be applying the proper scaling. I'm sure the scaling thing is probably a setting somewhere but I can't find which exactly. The bar spacing thing is a big deal for my discretionary trading.

I can't figure out why this is happening.

With thanks,
MK
Attachments
indicator_scale_issue_2.png
(32.9 KiB) Downloaded 1231 times
indicator_scale_issue_1.png
(31.19 KiB) Downloaded 1225 times

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Indicator scaling when based on hidden data

Postby Andrew MultiCharts » 09 Dec 2013

Hello MidKnight,

Instead of making the second data series Hidden, leave on Subchart #2, but in the Style tab of Format Instruments window you should select Invisible Bars. It will make the chart look as you expect.

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: Indicator scaling when based on hidden data

Postby MidKnight » 11 Dec 2013

Hi Andrew,

While your suggestion does fix the indicator scaling problem it is not what I want. Take a look at my screenshots showing your suggestion versus what I want.
Attachments
What_it_should_look_like.png
(22.54 KiB) Downloaded 1219 times
Andrew_MC_suggestion.png
(26.2 KiB) Downloaded 1238 times

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Indicator scaling when based on hidden data

Postby Andrew MultiCharts » 11 Dec 2013

Right-click on the chart -> Format Instruments -> select visible symbol -> Format -> Style -> Chart type: OHLC Var -> Ok.

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: Indicator scaling when based on hidden data

Postby MidKnight » 06 Feb 2014

Andrew,

Obviously my visible symbol on the chart is set to OHLC - that is why I was posting it as a problem. Your solution is not what I had posted a normal 5min chart would look like if it was the only symbol on the chart.

Please try your suggestion and tell me if you can get it to look like a normal 5min chart when you compress the spacing properly as you would if you were trading from the chart. I personally, would not use a spacing any larger than my screenshot.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Indicator scaling when based on hidden data

Postby Andrew MultiCharts » 07 Feb 2014

MidKnight,

I have studied the case in details and discussed with our engineers. You were right, the solution is recommended doesn't work in this case because you show the indicator on series 1, where it is not calculated. Since indicator is based on data 2, whatever you do with the series 2 (hide, make the bars invisible), the plots of the indicator on series 1 is based on series 2 and that's where the problem with scaling and bar spacing comes from. The only solution is to adjust code of the indicator to take values always from data 2, apply the code to data 1 (3 minutes) and make the scaling of the indicator = "same as instrument". Please find the modified code and screenshot below.
Attachments
VWAP_reset_Data2.pln
(1.46 KiB) Downloaded 457 times

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: Indicator scaling when based on hidden data

Postby MidKnight » 11 Feb 2014

Thanks Andrew,

This indicator is intended to replace the pre-packaged one? Won't this break my other charts that only have 1 data source on them? This pln looks like it will overwrite my existing vwap indicator.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Indicator scaling when based on hidden data

Postby Andrew MultiCharts » 12 Feb 2014

If you already have an indicator in PowerLanguage Editor with name VWAP_reset_Data2, yes it will replace it. If you don't have it, it will not replace it.

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: Indicator scaling when based on hidden data

Postby MidKnight » 12 Feb 2014

Hmm...that is a bit odd then. When I go to import into powerlanguage.net editor. The import dialog says it VWAP_reset indicator is being imported, and that is the same name as what comes with a standard install. I've stopped the import right here until I get further confirmation this will not clobber the existing indicator.

Attached is a screenshot of my import dialog.
Attachments
MK_2014-02-13_141009.png
(17.78 KiB) Downloaded 1209 times

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Indicator scaling when based on hidden data

Postby Andrew MultiCharts » 13 Feb 2014

Sorry, you are right, the indicator itself has the same name. Please disregard that file. Here is the correct one.
Attachments
VWAP_reset_Data2.pln
(1.46 KiB) Downloaded 452 times


Return to “MultiCharts .NET”