Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 945 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TMF function that works in different timeframes #462335
09/22/16 09:14
09/22/16 09:14
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
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/16 22:05
09/22/16 22:05
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
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/16 07:19
09/23/16 07:19
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
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/16 17:27
09/23/16 17:27
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
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/16 08:07
09/28/16 08:07
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Ok thanks

i did not think about it

i will leave this thread since it maybe useful for someone


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1