MACD strange values, cBot

Created at 04 Nov 2022, 17:03
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
V.

v.fiodorov83

Joined 24.07.2019

MACD strange values, cBot
04 Nov 2022, 17:03


Help me please. This MACD slows down my work. I can't figure out what the hell it's giving wrong values. Where they should be negative, it gives out positive ones and vice versa. No matter histogram or signal


        private MacdHistogram mcd;
      



        protected override void OnStart()

        {
            
            mcd = Indicators.MacdHistogram(shortCycle, longCycle, signalPeriod);
            
        }


        protected override void OnBar()

        {
            
            Print("H1 MACD: " + mcd.Histogram.LastValue));
            
        }

Here`s the results


@v.fiodorov83
Replies

v.fiodorov83
04 Nov 2022, 17:23

RE:

Sorry/ Admins, you can delete this post, this is my stupidity because I mixed up the long and short periods in places


@v.fiodorov83