I am using a build in indicator from Multicharts.NET, it is the OHLC Yesterday indicator. However, i do have an issue with it, but since i have 0 coding experience i hope there is someone here who can either help me out or point me in the right direction. The issue i am having is that my price scale is affected by the indicator, i will add an example. This one is the chart with the indicator, but as you can see there is a lot of empty space on the chart because of the lines of the indicator. The actual candles are being compressed because of this, as you can see on the screenshot below. This is the chart without the indicator and the candles are much higher and go from the bottom of the chart to the top of the chart. Is there a way to fix this so the lines don't have to be in sight if the price isn't close to the line?
This is the code: Code: using System; using System.Drawing; namespace PowerLanguage.Indicator { [SameAsSymbol(true)] public class OHLC_Yesterday : IndicatorObject { private VariableObject<Int32> m_counter; private VariableObject<Double> m_yestopen; private VariableObject<Double> m_todaysopen; private VariableObject<Double> m_yesthigh; private VariableObject<Double> m_todayshigh; private VariableObject<Double> m_yestlow; private VariableObject<Double> m_todayslow; private VariableObject<Double> m_yestclose; private IPlotObject Plot1; private IPlotObject Plot2; private IPlotObject Plot3; private IPlotObject Plot4; public OHLC_Yesterday(object ctx) : base(ctx) {} protected override void Create(){ m_counter = new VariableObject<Int32>(this); m_yestopen = new VariableObject<Double>(this); m_todaysopen = new VariableObject<Double>(this); m_yesthigh = new VariableObject<Double>(this); m_todayshigh = new VariableObject<Double>(this); m_yestlow = new VariableObject<Double>(this); m_todayslow = new VariableObject<Double>(this); m_yestclose = new VariableObject<Double>(this); Plot1 = AddPlot(new PlotAttributes("YestOpen", EPlotShapes.LeftTick, Color.Magenta, Color.Empty, 2, 0, true)); Plot2 = AddPlot(new PlotAttributes("YestHigh", EPlotShapes.LeftTick, Color.Blue, Color.Empty, 2, 0, true)); Plot3 = AddPlot(new PlotAttributes("YestLow", EPlotShapes.LeftTick, Color.Yellow, Color.Empty, 2, 0, true)); Plot4 = AddPlot(new PlotAttributes("YestClose", EPlotShapes.LeftTick, Color.Cyan, Color.Empty, 2, 0, true)); } protected override void CalcBar() { EResolution resolution = Bars.Info.Resolution.Type; if (resolution == EResolution.Quarter || EResolution.Week <= resolution && resolution <= EResolution.Year) return; if (Bars.Time[0].Date != Bars.Time[1].Date) { m_counter.Value = (m_counter.Value + 1); m_yestopen.Value = m_todaysopen.Value; m_yesthigh.Value = m_todayshigh.Value; m_yestlow.Value = m_todayslow.Value; m_yestclose.Value = Bars.Close[1]; m_todaysopen.Value = Bars.Open[0]; m_todayshigh.Value = Bars.High[0]; m_todayslow.Value = Bars.Low[0]; } else{ if (PublicFunctions.DoubleGreater(Bars.High[0], m_todayshigh.Value)){ m_todayshigh.Value = Bars.High[0]; } if (PublicFunctions.DoubleLess(Bars.Low[0], m_todayslow.Value)){ m_todayslow.Value = Bars.Low[0]; } } if (m_counter.Value >= 2) { Plot1.Set(0, m_yestopen.Value); Plot2.Set(0, m_yesthigh.Value); Plot3.Set(0, m_yestlow.Value); Plot4.Set(0, m_yestclose.Value); } } } }
Now i am having another issue . I wanted to try an alert on this same indicator, i activated the alert by clicking format indicator -> Alerts. There i have enabled alerts, tried on bar close, every tick or once per bar but neither of them are giving me an alert. I am not really sure how to the alert triggers on this indicator but i would assume it should give me an alert once price crosses any of the lines. Unfortunately nothing is happening.
I contacted Multicharts regarding the issue i am having but they told me technical support is provided by AMP instead of Multicharts, since i am using the special free version from AMP. I redirected my question to AMP but it looks like they don't know very much about the technical aspect of the platform. For my previous question i had a while ago they also needed to contact Multicharts since they couldn't figure it out themselves. Looks like this will take some time ...
To try and pinpoint the issue i have done some more test. When i plot a moving average on the chart and add an alert to that moving average, the alert does work. When i draw a horizontal line on the chart and add an alert to that horizontal line, the alert does not work.