Re: MT4 Indicator requests and ideas

201
Fudomyo wrote:hi Mladen. Thank you for helping me with this.

With the new MT4 code I can't figure out how to change the iMA mode. 

On the old Vidya version it was easy to find -

double price = iMA(NULL,0,1,0,MODE_SMA,price,i);

How do I change the MA mode on the new one? I can't seem to find it.

The reason I'm asking is, Chande originally used EMA for the volatility oscillator but I noticed a few versions use SMA, so I'd like to test it with different MA modes to find the best fit.

Thanks!  Fudo

Fudo,

That iMA() call is a "dirty little trick"
it is used in that form because that is the fastet way to get the desired price in mql (when no custom price types are used)since period is set to 1, regardless of what average type you use the return is always the same (any average with period set to 1 must return the price/value itself), so regardless what ma type you place there, unless the average period is changed from 1 to some other period, no change for the results will happen


Re: MT4 Indicator requests and ideas

203
OK, sorry if I'm a bit confused.

If the smooth period is set to 1, I understand that it will return actual price/value.

If the custom period for the smooth period is an EMA set higher than 1 wouldn't it produce an different result than an SMA for the same custom period?

I have a Vidya that came bundled with my broker software. I can't open it to check the code, but it appears that the smooth period is an EMA (which seems to be what Chande's original calculation is based on).

mladen wrote:
Fudo,

That iMA() call is a "dirty little trick"
it is used in that form because that is the fastet way to get the desired price in mql (when no custom price types are used)since period is set to 1, regardless of what average type you use the return is always the same (any average with period set to 1 must return the price/value itself), so regardless what ma type you place there, unless the average period is changed from 1 to some other period, no change for the results will happen
Attachments

Re: MT4 Indicator requests and ideas

204
Fudomyo wrote:OK, sorry if I'm a bit confused.

If the smooth period is set to 1, I understand that it will return actual price/value.

If the custom period for the smooth period is an EMA set higher than 1 wouldn't it produce an different result than an SMA for the same custom period?

I have a Vidya that came bundled with my broker software. I can't open it to check the code, but it appears that the smooth period is an EMA (which seems to be what Chande's original calculation is based on).
Fudo

Smooth period for Vidya has nothing to do with the iMA() you were checking
Smoothing in Vidya is EMA smoothing that is applied as the final step of Vidya calculation

Re: MT4 Indicator requests and ideas

205
hi Mladen,

OK, I got it.

CMO value is used as the ratio to the smoothing factor EMA, not of the EMA.

I had it completely backwards.

Thanks
mladen wrote:
Fudo

Smooth period for Vidya has nothing to do with the iMA() you were checking
Smoothing in Vidya is EMA smoothing that is applied as the final step of Vidya calculation


Re: MT4 Indicator requests and ideas

207
RplusT wrote:mLaden or mrTools
could you please correct the code of the attached indicator. It colours the wicks of both up and down candles in the same colour (uses the second colour).
I like using the Bar charts and this Indi allows to adjust the width to make those bette visible (like in Ninjatrader).
Thanks!

 NinjaCandlesticks.mq4     

 


That indicator simply copies ohlc prices to buffers
I don't know what was the intention of it, but better to use some other indicator that actually does something - for what it does now, simply turn the chart type to candles

Re: MT4 Indicator requests and ideas

208
Well, mLaden, that what it is supposed to do. It does not indicate anything but makes the bar charts much better visible yet does not cluster the chart like the candle stick. Some kind of Candlestick lite.
                                                                          
 
 
Attachments

Re: MT4 Indicator requests and ideas

209
RplusT wrote:Well, mLaden, that what it is supposed to do. It does not indicate anything but makes the bar charts much better visible yet does not cluster the chart like the candle stick. Some kind of Candlestick lite.
                                                                          
 
 
You don't need an indicator at all for that
Just set the colors of the chart in the chart properties to desired colors (bar type or candlestick type). And then you have the cleanest usage of them all

Re: MT4 Indicator requests and ideas

210
mladen wrote: You don't need an indicator at all for that
Just set the colors of the chart in the chart properties to desired colors (bar type or candlestick type). And then you have the cleanest usage of them all
mLaden, I use the MT4 for 8 years, so sure, I could handle that. But it does not allow me to change the width of the bars, which is the reason why I'm using it. But never mind. I don't want to waste your valuable time by having an argument back and forth.


Who is online

Users browsing this forum: Amazon [Bot], charli, IBM oBot [Bot], Proximic [Bot], SijjiN, Sogou [Bot], tradingant87 and 92 guests