Multitimeframe strategy for MACD

To add comments, please log in or register
David Diez
1262
David Diez  

Hi, I'd like to test an own expert advisor using several timeframes. Parameters would be:

Shorter_Period = (ex.M15), Longer_Period = (ex.H4). So the strategy will run through all of the periods between.

So then, we're going to consider this is for example applied to MACD indicator:

double Main=iMACD(Symbol(),MACD_Timeframe,FastEMA_Period,SlowEMA_Period,Signal_Period,PRICE_CLOSE,MODE_MAIN,OperationMode);
double Signal=iMACD(Symbol(),MACD_Timeframe,FastEMA_Period,SlowEMA_Period,Signal_Period,PRICE_CLOSE,MODE_SIGNAL,OperationMode);

So then how's that I have to set the function to match Main and Signal timeframe the same in such case as they're defined as variable?

iRick
231
iRick  

Just do them separately, so:

double MACDMain15m = iMACD(....

double MACDSignal15m = iMACD(....

double MACDMain1Hr = iMACD(....

double MACDSignal1Hr = iMACD(....

etc

David Diez
1262
David Diez  
iRick:

Just do them separately, so:

double MACDMain15m = iMACD(....

double MACDSignal15m = iMACD(....

double MACDMain1Hr = iMACD(....

double MACDSignal1Hr = iMACD(....

etc

Yes, that would be probably the easier way.

To add comments, please log in or register