The second switch statement seems off, as it's the same as the first.
switch(InpMethod)
{
case MODE_EMA : if(ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
case MODE_SMMA : if(SmoothedMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
case MODE_LWMA : if(LinearWeightedMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex,weight_sum)==0) return 0; break;
//---MODE_SMA
default : if(SimpleMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
}
switch(InpMethod)
{
case MODE_EMA : if(ExponentialMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
case MODE_SMMA : if(SmoothedMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
case MODE_LWMA : if(LinearWeightedMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal,weight_sum)==0) return 0; break;
//---MODE_SMA
default : if(SimpleMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
}
should be changed to
switch(InpMethod)
{
case MODE_EMA : if(ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
case MODE_SMMA : if(SmoothedMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
case MODE_LWMA : if(LinearWeightedMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex,weight_sum)==0) return 0; break;
//---MODE_SMA
default : if(SimpleMAOnBuffer(rates_total,prev_calculated,0,period_rex,BufferTVB,BufferRex)==0) return 0; break;
}
switch(InpMethodSig)
{
case MODE_EMA : if(ExponentialMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
case MODE_SMMA : if(SmoothedMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
case MODE_LWMA : if(LinearWeightedMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal,weight_sum)==0) return 0; break;
//---MODE_SMA
default : if(SimpleMAOnBuffer(rates_total,prev_calculated,period_rex,period_sig,BufferRex,BufferSignal)==0) return 0; break;
}
declaration of 'weight_sum' hides global variable MovingAverages.mqh 222 155
Warning when compiling.
Hi Scriptor, thanks for the free indicators, I am unable to write code but I've been using a website called FXDreema to try to create a bot, I'd like to use the rex indicator to try but it doesn't show the buffers when I load, would it be possible to do this?
Thanks

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
Rex:
The indicator of probable market reversal based on the true bar value (True Value of Bar).
Author: Scriptor