MTF Values question.

 

Hi,

I put PERIOD_M1 in the Timeframe param, and attach this indicator to a M5-chart (not M1-chart).

double MA20=iMA(NULL,PERIOD_M1,20,0,MODE_SMA,PRICE_CLOSE,1);

What does this give me? The value of MA-20 on M5's last bar, or value of MA-20 on M1's last bar?

I am having trouble with obtaining past and current values for lower and higher timeframes. This indicator is attached on M5-Timeframe, and it wants to monitor activity on Higher M15 and Lower M1 Timeframes.

e.g. If MACD-15 > Signal-15, and Stoch-1 has a upward cross, then signal Buy.

for(int i=999;i>=0;i--){

if(MACD15>Signal15 && (Stoch_Base_Prev < Stoch_Signal_Prev && Stoch_Base>Stoch_Signal){

signal="BUY";

}

}

How do I obtain the data values of higher/ lower timeframes, used in this if statement?

double MACD15=iMACD(NULL,...??????);

double Signal15=iMACD(NULL,...??????);

double Stoch_Base_Prev=iMACD(NULL,...??????);

double Stoch_Signal_Prev =iMACD(NULL,...??????);

double Stoch_Base=iMACD(NULL,...??????);

double Stoch_Signal=iMACD(NULL,...??????);

Lastly, is there any VISUAL/ Interactive tool/ software to generate indicators based on simple conditions like MACD crosses, etc.?

Thanks,

JForex.

 

JF

> What does this give me?

The value of MA-20 on M1's last bar

> How do I obtain the data values of higher/ lower timeframes

You have the idea already, use the Timeframe parameter of indicators, iHigh etc

> is there any VISUAL/ Interactive tool/ software to generate indicators

Not to my knowledge - Google for it and let us know if you find one :)

IMHO, signals such as you describe are best used direct in an EA rather adding a custom indicator which itself would need to be read by the EA

Good Luck

-BB-

Reason: