Indicator messing up my charts  [SOLVED]

Questions about MultiCharts and user contributed studies.
altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Indicator messing up my charts

Postby altoncrooks » 18 Jul 2022

I made an indicator that tracks my stops on the chart. Unfortunately, when the stop is filled the indicator calculation goes to zero which messes up the scaling of my chart. Is there a way that I can fix this?

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Indicator messing up my charts

Postby ABC » 19 Jul 2022

altoncrooks,

probably, but without seeing the code one can only guess. The easiest approach might be plotting your values if they are not zero only.

Unchecking the "Expand Scale to Indicators" box on the "Scaling" tab of the "Format Instrument" dialog can also be useful for some studies.

Regards,

ABC

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts

Postby altoncrooks » 19 Jul 2022

ABC
Thank you for this. It worked. Is there a way to do this on indicators that are not on the same chart with an instrument? I am using an RSI indicator and I connected the setting of the RSI with a signal using a fuction. For some reason the centerline just drops to zero at the far right. Is there a checkbox I need to uncheck or check to fix this?

Alton
altoncrooks,

probably, but without seeing the code one can only guess. The easiest approach might be plotting your values if they are not zero only.

Unchecking the "Expand Scale to Indicators" box on the "Scaling" tab of the "Format Instrument" dialog can also be useful for some studies.

Regards,

ABC

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Indicator messing up my charts

Postby TJ » 19 Jul 2022

you should post a screen shot,
with notes on the chart pointing to the problem, and your vision of how it should look.

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Indicator messing up my charts

Postby ABC » 20 Jul 2022

Alton,

this sounds like something you would have to address on the code level.

Regards,

ABC

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts

Postby altoncrooks » 20 Jul 2022

As you can see from the attachment, the centerline of the two ocsillators in the bottom two charts drops off to zero at the far right. I do not know why it does that. If anyone knows how to get them to stay in the half way point and not drop off at the end, I would greatly appreciate any help.
Oscillator error.PNG
(114.72 KiB) Not downloaded yet
Image
Last edited by altoncrooks on 20 Jul 2022, edited 1 time in total.

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts

Postby altoncrooks » 20 Jul 2022

I hope this works. I tried to post a picture of what I am talking about but it does not come up as a picture. Thank you for any help you can provide. I would like to have the centerline on the two oscillators on the bottom charts stay in the center at the far right. Right now they just drop off to zero.
Oscillator error.PNG
(114.72 KiB) Not downloaded yet
Image
Last edited by altoncrooks on 20 Jul 2022, edited 1 time in total.

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts

Postby altoncrooks » 20 Jul 2022

I figured out how to post a picture. As you can see the centerline drops to zero. I would like the centerline to remain in the center at the Far Right. Thank you in advance for any help.

Image
Attachments
Oscillator error.PNG
(114.72 KiB) Not downloaded yet

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Indicator messing up my charts

Postby TJ » 21 Jul 2022

Computers are dumb; they do exactly what they are told to do.

This is a simple coding issue. You need to post your code.

viewtopic.php?t=11713

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts

Postby altoncrooks » 21 Jul 2022

Code: Select all

inputs: Price( Close ), Length( 14 ), OverSColor( red ), OverBColor( cyan ) ; variables: RSIhld( 0 ), OverBought( 0 ), OverSold( 0 ), var0( 0 ) ; //Length = AccuracySetNamedInt("gRSIPer", Length); //RSIhld = AccuracyGetNamedInt("gRSIhld", RSIhld); RSIhld = i_getplotvalue(1); OverBought = RSIhld; OverSold = RSIhld; var0 = RSI( Price, Length ) ; Plot1( var0, "RSI" ) ; Plot2( OverBought, "OverBot" ) ; Plot3( OverSold, "OverSld" ) ; if var0 > OverBought then SetPlotColor( 1, OverBColor ) else if var0 < OverSold then SetPlotColor( 1, OverSColor ) ; condition1 = var0 crosses over OverSold ; if condition1 then Alert( "Indicator exiting oversold zone" ) else begin condition1 = var0 crosses under OverBought ; if condition1 then Alert( "Indicator exiting overbought zone" ) ; end;

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Indicator messing up my charts

Postby ABC » 22 Jul 2022

Alton,

please refer to the second sentence of the first reply in this thread. Checking the value before you plot should solve your problem.

When you are dealing with static values like overbought/oversold values you could also save them in a variable once and then use this variable and not call i_GetPlotValue on every code calculation.

Regards,

ABC

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Indicator messing up my charts  [SOLVED]

Postby altoncrooks » 27 Jul 2022

Thank you so much. Your advice worked. Thank you, sir!

Alton,

please refer to the second sentence of the first reply in this thread. Checking the value before you plot should solve your problem.

When you are dealing with static values like overbought/oversold values you could also save them in a variable once and then use this variable and not call i_GetPlotValue on every code calculation.

Regards,

ABC


Return to “MultiCharts”