Right now TMF works either each tick or each candle defined by the BarPeriod, depending on the setup of the return value. It would be nice if the TMF could work something in between. There is no point to setup the barperiod on h1 if the strategy works on D1 just to get the tmf function to work each hour. I know one can use th TimeFrame function but the barperiod defines the plots instead so something like BarPeriodTMF = 60; and return 20 for this case would be useful.
Re: TMF function that works in different timeframes
[Re: nanotir]
#462346 09/22/1622:0509/22/1622:05
I might missunderstand you but within a TMF you can check time (day, hour, minute, second) so where is the problem to do an action each hour on a daily BarPeriod?
Re: TMF function that works in different timeframes
[Re: Sphin]
#462351 09/23/1607:1909/23/1607:19
Maybe it is me who do not understand the function. For me the return value defines if TMF acts each tick or each candle, so how can I have 3 conditions inside the tmf function for M1, h1 and D1 for example?
Re: TMF function that works in different timeframes
[Re: nanotir]
#462359 09/23/1617:2709/23/1617:27
You can influence the behaviour of the TMF with the return values but you don't have to. Normally in trading the TMF runs every tick and therefore you can check your conditions each moment you like.
Code:
int DoTrade() {
if(TradeIsNewBar)
// this condition is checked only once per bar
if(hour() % 2 == 0 && ...)
// this condition is checked only in even hours
if(hour() == ... && minute() == ... && ...)
// this is checked e.g. at a special hour/minute combination
return 0;
}
Re: TMF function that works in different timeframes
[Re: Sphin]
#462408 09/28/1608:0709/28/1608:07