Indicator messing up my charts [SOLVED]
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Indicator messing up my charts
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?
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Indicator messing up my charts
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
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
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts
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
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
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Indicator messing up my charts
you should post a screen shot,
with notes on the chart pointing to the problem, and your vision of how it should look.
with notes on the chart pointing to the problem, and your vision of how it should look.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Indicator messing up my charts
Alton,
this sounds like something you would have to address on the code level.
Regards,
ABC
this sounds like something you would have to address on the code level.
Regards,
ABC
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts
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.
Last edited by altoncrooks on 20 Jul 2022, edited 1 time in total.
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts
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.
Last edited by altoncrooks on 20 Jul 2022, edited 1 time in total.
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts
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.
- Attachments
-
- Oscillator error.PNG
- (114.72 KiB) Not downloaded yet
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Indicator messing up my charts
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
This is a simple coding issue. You need to post your code.
viewtopic.php?t=11713
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts
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;
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Indicator messing up my charts
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
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
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Indicator messing up my charts [SOLVED]
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