AFAIK it is not working in mt4 only in mt5
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
As a test of the DRAW_FILLING functionality with MT4 build 625, I wrote the following simple code:
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots 1
// Plot 1
#property indicator_label1 "Candle spread"
#property indicator_type1 DRAW_FILLING
#property indicator_color1 clrAqua,clrOrange
#property indicator_width1 1
// Indicator buffers
double fillBuffer1[];
double fillBuffer2[];
int OnInit()
{
SetIndexBuffer(0, fillBuffer1, INDICATOR_DATA);
SetIndexBuffer(1, fillBuffer2, INDICATOR_DATA);
return INIT_SUCCEEDED;
}
void OnDeinit(const int reason)
{
// Nothing to deinit
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
ArraySetAsSeries(fillBuffer1, false);
ArraySetAsSeries(fillBuffer2, false);
ArraySetAsSeries(high, false);
ArraySetAsSeries(low, false);
for (int i = 0; i < rates_total; i++)
{
fillBuffer1[i] = high[i];
fillBuffer2[i] = low[i];
}
return rates_total;
}
This code gives unexpected results since only the upper boundary of the channel is drawn in the separate window:
http://gyazo.com/f7731aa65dc71a8ff0a18a4ca37e5ac5
Is there plan to implement this DRAW_FILLING functionality in the future builds or the problem lies in my code?
Kind regards
Thierry