Multi Timeframe Indicators - page 350

 

pipware-minichart-v3.0.ex4‎ (39.8 KB, 7 views)

this one looks like it is a form of TEXT profiler for diff TF

you could set the alphabet G for moving average

 

MTF in BackTesting

Does anyone have any experience using MTF indicators in backtesting in the Strategy Tester? My preliminary indications are that the Strategy Tester cannot provide the higher time frame when the indicator is called using the iCustom function. Is this correct or am I doing something wrong in the call?

 
Tzuman:
Does anyone have any experience using MTF indicators in backtesting in the Strategy Tester? My preliminary indications are that the Strategy Tester cannot provide the higher time frame when the indicator is called using the iCustom function. Is this correct or am I doing something wrong in the call?

This is correct. You can't in MT4. If you go back a few pages on this thread, Robert and I talked about this and some solution. I've made quite a few EAs dealing with MTF indicator. You can't use them directly.

 

MTF in BackTesting

Thanks Christina, it is what I expected that in back testing only the current time frame is calculated.

I also have two more questions

If you use iCustom in an EA and do not pass it any parameters, does it use it's defaults. And if you pass it only the first couple of it's parameters but not all, does it use the defaults for the rest. My indications are that it does.

Second and most importantly, when a slow mtf indicator is called twice in an EA with actual data not backtesting, first for the first bar[1] and second for the second bar[2].

double fast1 =iCustom(Symbol(),NULL,"MTF",Fast.TimeFrame,3,1);

double slow1=iCustom(Symbol(),NULL,"MTF",Slow.TimeFrame,4,1);

double slow2=iCustom(Symbol(),NULL,"MTF",Slow.TimeFrame,4,2);

I presume that slow1 references the values in Bar[1] and slow2 references the values in Bar[2] of the slow indicator on its timeframe. When this slow timeframe is mapped onto the fast indicator, these values represent Bar[1] of the fast bar and Bar[5] of the fast bar assuming an H1 & H4 time frames (4::1). However, if I show the Data Window, CTL D, the intermediate Bars,2, 3, 4, on the lower time interval have values for the Slow indicator. Is there any way to access these slow "intermediate" values as the Data Window does? Specifically, there is a buy sell arrow that is showing up in the intermediate values that I would like to capture. My indicator is highly complex; it is one of the Ganns with a Hilbert transformation and smoothing and I would prefer not to try to translate it into an EA at this time if there are other options. Your technique of direct use of a built in "i" function would not work in my case.

Thanks to everyone for any suggestions

Tzuman

 
Tzuman:
Thanks Christina, it is what I expected that in back testing only the current time frame is calculated.

I also have two more questions

If you use iCustom in an EA and do not pass it any parameters, does it use it's defaults. And if you pass it only the first couple of it's parameters but not all, does it use the defaults for the rest. My indications are that it does.

Second and most importantly, when a slow mtf indicator is called twice in an EA with actual data not backtesting, first for the first bar[1] and second for the second bar[2].

double fast1 =iCustom(Symbol(),NULL,"MTF",Fast.TimeFrame,3,1);

double slow1=iCustom(Symbol(),NULL,"MTF",Slow.TimeFrame,4,1);

double slow2=iCustom(Symbol(),NULL,"MTF",Slow.TimeFrame,4,2);

I presume that slow1 references the values in Bar[1] and slow2 references the values in Bar[2] of the slow indicator on its timeframe. When this slow timeframe is mapped onto the fast indicator, these values represent Bar[1] of the fast bar and Bar[5] of the fast bar assuming an H1 & H4 time frames (4::1). However, if I show the Data Window, CTL D, the intermediate Bars,2, 3, 4, on the lower time interval have values for the Slow indicator. Is there any way to access these slow "intermediate" values as the Data Window does? Specifically, there is a buy sell arrow that is showing up in the intermediate values that I would like to capture. My indicator is highly complex; it is one of the Ganns with a Hilbert transformation and smoothing and I would prefer not to try to translate it into an EA at this time if there are other options. Your technique of direct use of a built in "i" function would not work in my case.

Thanks to everyone for any suggestions

Tzuman

What I'm talking about does not involve coding the entire logic in the EA. It requires creating a new non MTF version of your current indicator. Which can be easily done, simply take out all the code that makes it MTF. I don't care how complicated your logic is, that part will be untouched.

The EA will call the non MTF version of the indicator, you just need to call it on the right time frame. For example, if you are trading on 1h and you want the value for 4h:

double slow1=iCustom(Symbol(),240,"NON MTF",Slow.TimeFrame,4,shift);

If the shift=0, means taking intermediate value on bar0 of 4h chart, if shift=1, that means the last closed bar value of bar1 of 4h chart. This makes the logic exceedingly clear.

I've coded many MTF EAs using this approach and it's very easy to do.

 

MTF in BackTesting

Thank you for the tip, I will try it.

on the shift, my question was how do you look at the values of the H4 indicator on the H1 time frame. The Data Window clearly shows intermediate values which if possible I would like to access as they are different from the H4 Bar 1 or 2 values. I am hoping there is a way to "get" at them which involves a different type of access than iCustom. These intermediate values look like Metatrader is calling the H4 indicator on every H1 bar close and calculating the intermediate H4 values and storing them on the H1 time frame bars.

Thanks again,

Tzuman

 
Tzuman:
Thank you for the tip, I will try it.

on the shift, my question was how do you look at the values of the H4 indicator on the H1 time frame. The Data Window clearly shows intermediate values which if possible I would like to access as they are different from the H4 Bar 1 or 2 values. I am hoping there is a way to "get" at them which involves a different type of access than iCustom. These intermediate values look like Metatrader is calling the H4 indicator on every H1 bar close and calculating the intermediate H4 values and storing them on the H1 time frame bars.

Thanks again,

Tzuman

as you might noticed, on 1h chart, your mtf indi will always force the intermediate value of 4h to be the same, that's why up to 4 recent bars could repaint and they are always the same, which represents the bar0 value on 4h chart at any given point.

 

Not on my chart, the Data Window clearly shows 3 different values for H4 intermediate intervals. My interest lies in one of the indices is a buy/sell arrow which only paints on an intermediate value and you are correct sometimes it is repainted but I still would like to access it.

If I ever find the solution, I'll let you know. I do appreciate your suggestions

Tzuman

 

PL dot MTF?

Hi coders on forex-tsd,

I am in need of this indi in multi timeframe. Can some one please kindly help? I heard that it is a simple MA (H+L+C)/3 shift 1. Great thanks in advance.

Regards,

Files:
 

iCustom Needs ALL Parameters

Tzuman:
Not on my chart, the Data Window clearly shows 3 different values for H4 intermediate intervals. My interest lies in one of the indices is a buy/sell arrow which only paints on an intermediate value and you are correct sometimes it is repainted but I still would like to access it.

If I ever find the solution, I'll let you know. I do appreciate your suggestions

Tzuman

Hi Tzuman,

Not sure if you've made more progress with this or not...so here's my suggestions...

You asked earlier..."If you use iCustom in an EA and do not pass it any parameters, does it use it's defaults. And if you pass it only the first couple of it's parameters but not all, does it use the defaults for the rest. My indications are that it does."

iCustom usually requires ALL parameters to be included... There may be some exceptions, but it's better to be safe to include them all.

In some cases I have disabled (// blanked) all the "externs" in the indicators that the EA uses...to make it much simpler to use the indicators in my iCustoms with a higher confidence that I am getting the correct values. That way I just need to add the buffer and bar shift and not worry about parameters.

Otherwise...it's better to add ALL the parameters in the iCustom statements.

Secondly, if you are actually seeing the intermediate values from your indicators in your Data Window...then they should be retrievable with your iCustom statements, and also your Print and Comments should be able to show the values once you got them with your iCustom.

Regarding the Buy/Sell arrows - look in the indicators directly to see which buffers they are using...then use those buffers in the iCustom statements.

Hope this helps,

Robert