Topic: Adding bars shift to TopBottom indicator

Hello i added shift by bars to topbottom price and it works fine when the base price is one bar or one day but when use the week it starts drawing lines in a wrong way !!!!!

// Reading the parameters
            double shift = IndParam.NumParam[0].Value*Point;
            var shift1 = (int)IndParam.NumParam[1].Value;
            int firstBar = 1 + shift1;

            // Calculation
            var adTopPrice = new double[Bars];
            var adBottomPrice = new double[Bars];

            adTopPrice[0] = 0;
            adBottomPrice[0] = 0;

            double dTop = double.MinValue;
            double dBottom = double.MaxValue;

            for (int bar = 1; bar < Bars - shift1; bar++)
            {
                if (High[bar - 1] > dTop)
                    dTop = High[bar - 1];
                if (Low[bar - 1] < dBottom)
                    dBottom = Low[bar - 1];

                if (IsPeriodChanged(bar + shift1))
                {
                    adTopPrice[bar + shift1] = dTop;
                    adBottomPrice[bar + shift1] = dBottom;
                    dTop = double.MinValue;
                    dBottom = double.MaxValue;
                }
                else
                {
                    adTopPrice[bar + shift1] = adTopPrice[bar - 1];
                    adBottomPrice[bar + shift1] = adBottomPrice[bar - 1];
                }
            }

            var adUpperBand = new double[Bars];
            var adLowerBand = new double[Bars];
            for (int bar = firstBar; bar < Bars; bar++)
            {
                adUpperBand[bar] = adTopPrice[bar];
                adLowerBand[bar] = adBottomPrice[bar];
            }

Re: Adding bars shift to TopBottom indicator

Hello There


I need to shift the bigger time frame

Any help about that issue

Re: Adding bars shift to TopBottom indicator

I need to shift the bigger time frame

It seams there is an issue with shifting LTF indicators in FSB Pro. It looks like ti shift the signals with one original period bar instead of one LTF bar.

I'll fix this problem.

I'll also separate the shift At/Any option to two options:
Signal shift      ###
Signal repeat  ###

Re: Adding bars shift to TopBottom indicator

Popov wrote:

I need to shift the bigger time frame

It seams there is an issue with shifting LTF indicators in FSB Pro. It looks like ti shift the signals with one original period bar instead of one LTF bar.

I'll fix this problem.

Waw iam waiting this modification it will adds new muscles to the indicators functions

Re: Adding bars shift to TopBottom indicator

Popov wrote:

I'll also separate the shift At/Any option to two options:
Signal shift      ###
Signal repeat  ###

What you mean smile   with example please

Re: Adding bars shift to TopBottom indicator

Initial signals: 0 0 0 1 0 0 0 0
Shit signal 1  : 0 0 0 0 1 0 0 0

Initial signals: 0 0 0 1 0 0 0 0
Shit signal 2  : 0 0 0 0 0 1 0 0

Initial signals    : 0 0 0 1 0 0 0 0
Repeat signal 1: 0 0 0 1 1 0 0 0


Initial signals    : 0 0 0 1 0 0 0 0
Repeat signal 2: 0 0 0 1 1 1 0 0



Initial signals                                : 0 0 0 1 0 0 0 0
Repeat signal 1 and Shift signal 1: 0 0 0 0 1 1 0 0


Initial signals                                : 0 0 0 1 0 0 0 0
Repeat signal 2 and Shift signal 1: 0 0 0 0 1 1 1 0

Re: Adding bars shift to TopBottom indicator

Popov wrote:

Initial signals: 0 0 0 1 0 0 0 0
Shit signal 1  : 0 0 0 0 1 0 0 0

Initial signals: 0 0 0 1 0 0 0 0
Shit signal 2  : 0 0 0 0 0 1 0 0

Initial signals    : 0 0 0 1 0 0 0 0
Repeat signal 1: 0 0 0 1 1 0 0 0


Initial signals    : 0 0 0 1 0 0 0 0
Repeat signal 2: 0 0 0 1 1 1 0 0



Initial signals                                : 0 0 0 1 0 0 0 0
Repeat signal 1 and Shift signal 1: 0 0 0 0 1 1 0 0


Initial signals                                : 0 0 0 1 0 0 0 0
Repeat signal 2 and Shift signal 1: 0 0 0 0 1 1 1 0


Fantastic Job

Is it  build-in in the program or also coded in some indicators  !!!

Re: Adding bars shift to TopBottom indicator

It already runs on FSB Pro. It's named Signal shift At (shift) and Signal shift Any (repeat).
I'll only extract Signal repeat to a separate option in order to make it working with the shift.

http://s7.postimg.org/wcnjt7c6z/screenshot_311.png