# BB-Fibs

7

New at programming, need help programming a Bollinger Bands - Fibonacci Indicator. It is like a regular BBs but instead of using standard deviation as the measure of volatility, a Wilders Smoothed ATR is used in its place. The middle band remains the same.

UpperBand3:= MidPoint + (factor3 * Smoothed ATR);     Factor3 = 4.236
UpperBand2:= MidPoint + (factor2 * Smoothed ATR);     Factor2 = 2.618
UpperBand1:= MidPoint + (factor1 * Smoothed ATR);     Factor1 = 1.618

MiddleBand = same as Bollinger Bands;

LowerBand1:= MidPoint - (factor1 * Smoothed ATR);     Factor1 = 1.618
LowerBand2:= MidPoint - (factor2 * Smoothed ATR);     Factor2 = 2.618
LowerBand3:= MidPoint - (factor3 * Smoothed ATR);     Factor3 = 4.236

While compiling there is a problem on the Custom indicator iteration function as shown in the attached image.

I will add my code just in case someone takes a look at it and helps me with my programming skills

I appreciate the help and looking forward for the book.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
• www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Files:
BBgFibs.jpg 409 kb
Admin
14358

I see 12 parameters in your OnCalculate function on the picture. Must be 10 ones according to https://www.mql5.com/en/docs/basis/function/events#oncalculate

```int OnCalculate (const int rates_total,      // size of input timeseries
const int prev_calculated,  // bars handled in previous call
const datetime& time[],     // Time
const double& open[],       // Open
const double& high[],       // High
const double& low[],        // Low
const double& close[],      // Close
const long& tick_volume[],  // Tick Volume
const long& volume[],       // Real Volume
const int& spread[]         // Spread
);```
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
• www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
6

Hello, I am looking for that exact indicator but for MT4 instead. I am new to MT4 and don't know how to program it. It is possible to make one for me?

Thanks you

Dominique

6

Niche, it is ok I found it. For MT4 it is call  Bands- fibo- true.

Thanks anyway.

Dominique

To add comments, please log in or register