Help me to implement my coding?

 

Hi,

I just learning MQL coding. i implemented my coding knowledge by provided free coding service.

Here is i have one EA to be done.

Which uses 3 indicators.

Main indicator uses 1hr timeframe to find the trend .

other 2 indicators uses 5min to enter the trade.

My question is :

I have coded many indicators with same timeframe before and succeeded.also i tried coded for this different tf and tested nothing works for me.

but this time one indicator uses 1hr timeframe and other 2 indicators 5min timeframe.

please help me that, how to write code for these different indicators and different timeframes.

Thank you in advance.

Sheriff

 
sheriffonline:

Hi,

I just learning MQL coding. i implemented my coding knowledge by provided free coding service.

Here is i have one EA to be done.

Which uses 3 indicators.

Main indicator uses 1hr timeframe to find the trend .

other 2 indicators uses 5min to enter the trade.

My question is :

I have coded many indicators with same timeframe before and succeeded.also i tried coded for this different tf and tested nothing works for me.

but this time one indicator uses 1hr timeframe and other 2 indicators 5min timeframe.

please help me that, how to write code for these different indicators and different timeframes.

Thank you in advance.

Sheriff

Then my question to you.....         The indicator moving average

 

double iMA(     string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)

Calculates the Moving average indicator and returns its value.
symbol    -     Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe         -     Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
period    -     Averaging period for calculation.
ma_shift          -     MA shift. Indicators line offset relate to the chart by timeframe.
ma_method         -     MA method. It can be any of the Moving Average method enumeration value.
applied_price     -     Applied price. It can be any of Applied price enumeration values.
shift     -     Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).


how can you write this indicator working different timeframes.






 

For 5min iMA(NULL, PERIOD_M5,21,0,MODE_EMA,PRICE_CLOSE,0)

For 15min iMA(NULL, PERIOD_M15,21,0,MODE_EMA,PRICE_CLOSE,0)

 
sheriffonline:

For 5min iMA(NULL, PERIOD_M5,21,0,MODE_EMA,PRICE_CLOSE,0)

For 15min iMA(NULL, PERIOD_M15,21,0,MODE_EMA,PRICE_CLOSE,0)


So with that indicator you know how to do, do you know it now also for your other indicators ??
Reason: