Any assistance would be appreciated. Thanks in advance.
I'm not 100% sure if this affects MT4, but best practice is to put your custom functions after the OnCalculate() return statement--instead of frontloading them ahead of OnInit().
//+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate( const int rates_total, // total number of bars on the current tick const int prev_calculated,// number of calculated bars on the previous tick const datetime& time[], const double& open[], const double& high[], // price array for the maximum price for the indicator calculation const double& low[], // price array for the minimum price for the indicator calculation const double& close[], const long& tick_volume[], const long& volume[], const int& spread[] ) { //---+ //--- checking the number of bars if (rates_total < AroonPeriod - 1) return(0); //--- declare the local variables int first, bar; double BULLS, BEARS; //--- calculation of the starting bar number if (prev_calculated == 0) // checking for the first start of the indicator calculation first = AroonPeriod - 1; // starting number for the calculation of all of the bars else first = prev_calculated - 1; // starting number for the calculation of new bars //--- main loop for(bar = first; bar < rates_total; bar++) { //--- calculation of values BULLS = 100 - (bar - iHighest(high, AroonPeriod, bar) + 0.5) * 100 / AroonPeriod; BEARS = 100 - (bar - iLowest (low, AroonPeriod, bar) + 0.5) * 100 / AroonPeriod; //--- filling the indicator buffers with the calculated values BullsAroonBuffer[bar] = BULLS; BearsAroonBuffer[bar] = BEARS; } //---+ return(rates_total); } //+------------------------------------------------------------------+
Creating an Indicator with Multiple Indicator Buffers for Newbies
Nikolay Kositsin, 2010.12.08 10:53
The complex codes consist of a set of simple codes. If you are familiar with them, it doesn't look so complicated. In this article, we will consider how to create an indicator with multiple indicator buffers. As an example, the Aroon indicator is analyzed in details, and two different versions of the code are presented.Thanks for the help, but I am really out of my depth here. I would not know how to insert that into my code.
If I'm not mistaken, your code has 1 invisible indicator buffer and draws objects in lieu thereof. At this point I have to say... rewrite the whole thing into an Expert Advisor which uses OnTick() instead of OnCalculate(). It would largely be copy & paste. This is not unusual. There are plenty of object-drawing EA's out there.
If I'm not mistaken, your code has 1 invisible indicator buffer and draws objects in lieu thereof. At this point I have to say... rewrite the whole thing into an Expert Advisor which uses OnTick() instead of OnCalculate(). It would largely be copy & paste. This is not unusual. There are plenty of object-drawing EA's out there.
Thanks, I will give that a try, not sure if it will render the rectangle bars though.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Morning, The indicator does not show/render in the live environment. The indicator work perfectly in the Strategy tester.
I am using MT4 Version 4.00 build 1441
Windows 10
--------------
Screenshot shows the indicator with total tick volume and the delta for the day.
GBPUSD M5 chart.
Any assistance would be appreciated. Thanks in advance.