Question about multi-currency EAs. Why are there so few robots based on the event OnTimer()? - page 2

 
angevoyageur: Honestly I don't see how OnTimer() could be used advantageously for trading (single or multi currency). What is a strategy based on OnTimer(), how can it work ? It could be very interesting if someone can develop ideas on this base.

I believe MQ added the OnTimer() for people who were using endless-loop-sleep logic with meta-trader4. In the old_mt4 documentations, putting EA/Scripts within endless_loops was-not recommend and used-to crashed the terminal. The article shows that there's a better way for multi-currency instead of OnTimer(). As far as usages for the OnTimer(): How about systems which needs something done at a particular time. Example: close all my open positions on friday at 11:59. OnTimer could also be used for preserving some cpu-processes. If once_per_bar is too long for you && everytick for every symbol is too much. Then perhaps once every 10 seconds would make them happy.

Yeah, not very good reasons ;)  ... but I think OnTimer() function is worth keeping. 

 
Ubzen:

I believe MQ added the OnTimer() for people who were using endless-loop-sleep logic with meta-trader4. In the old_mt4 documentations, putting EA/Scripts within endless_loops was-not recommend and used-to crashed the terminal. The article shows that there's a better way for multi-currency instead of OnTimer(). As far as usages for the OnTimer(): How about systems which needs something done at a particular time. Example: close all my open positions on friday at 11:59. OnTimer could also be used for preserving some cpu-processes. If once_per_bar is too long for you && everytick for every symbol is too much. Then perhaps once every 10 seconds would make them happy.

Yeah, not very good reasons ;)  ... but I think OnTimer() function is worth keeping. 

Absolutely, it's worth keeping...but not for multi-currency EA We have only to find some good uses for it.
 

Ok, thks, interesting to know all this! I have no much experience with the previous versión of MQL. I had thought that OnTimer() would be useful for multi-currency systems whenever they are conceived as distributed. So no matter how the currency pairs are synchronized because they are different under this paradigm! Why can't you look at your watch and then take a trading decision involving many currency pairs? That would be the idea from my point of view right now. This way the ticks are not important, it has no sense wasting time trying to order (trying to synchronize) something which is a bit chaotic by nature.

We already know that right now (1) there are some differences in the ticks served by brokers, (2) there is also a desynchronization with respect to the actual price movements, and (3) ticks are arbitrary discretizations of human behavior. The data encapsulated by ticks is not very certain because all this. So why are we forced to build robots relying on ticks? Why do we have to synchronize many price movements? Aren't you taking a priori a deterministic position in order to code your EAs?

Well this is the theory in my humble opinion. I will try to code a mutli-currency robot based on OnTimer. Maybe when I will be dealing with the technical difficulties you see now I conclude it's not posible.

Thks very much! 

 
laplacianlab: Why can't you look at your watch and then take a trading decision involving many currency pairs?

You certainly can, this is trading Logic issue. No-one here is arguing that you cannot. No, different then if you wanted to trade Once_Per_Day. I agree with your general argument about ticks not being synchronize so why bother with ticks. However, the synchronization of ticks becomes important for someone looking to use Strategy-Tester. I'll give a case example below.

Someone wants to use a Triangle-Arbitrage where GBP/USD * EUR/GBP (must equal) EUR/USD. if( GU*EG != EU ) OrderSend;

This type of strategy cannot use Strategy_Tester because the historical-data cannot be Synchronized. Synchronized meaning Time which is limited to Unix-Format is limited to Seconds resolutions. Tick-data is time.Independent, even-though tick-data may carry time-information it doesn't really need it. All it needs to know is which tick-came after the other. In a text-file, the next tick will be on the line-below the first, even though they have the same time-stamp.

Now the Problem, EurUsd has 9_Ticks that Second. GbpUsd has 5_Ticks that Second. And EurGbp has 2_Ticks that Second. Question, which GbpUsd_Tick does EurUsd_Tick#6 matches with?

The above is just a Strategy-Tester problem. Should someone want to test such strategies Live, I don't see the limitation and using tick_events as noted in the article would be the better way to go. 

Using your watch or time-cycles implies that your strategy is-not tick_sensitive. It doesn't imply that it's any less profitable than ticks. These are just my opinions | examples provided are broad | tick_data import should still be allowed by meta-quotes ;)

Ps: you probably already know all this stuff, I just don't want to leave allot of assumptions, and confuse some reader who doesn't know.

 
I wonder if OnTimer() work in the Strategy Tester ?  if it's set to 2 seconds and there are no ticks for 20 seconds . . .
 
RaptorUK:
I wonder if OnTimer() work in the Strategy Tester ?  if it's set to 2 seconds and there are no ticks for 20 seconds . . .
Please read the documentation
 
angevoyageur:
Please read the documentation
Thank you.  I'm a little surprised . . . but it is nice to see some functions being fully implemented for the Strategy Tester.  
 
RaptorUK: I wonder if OnTimer() work in the Strategy Tester ?  if it's set to 2 seconds and there are no ticks for 20 seconds . . .
You mean if there are no Renat_Ticks for 20 seconds :))))
 
Ubzen:
You mean if there are no Renat_Ticks for 20 seconds :))))
Reason: