multi currency in back test!

 

Hi 





is it possible to create an EA that trades multi currency in the same EA???? 


any body know ?? 





* I have the code for that and it is not working with more than a currency pair 

 

void OnTick() 
{ 
string eurusd = "EURUSD", eurjpy = "EURJPY", usdcad = "USDCAD", gbpnzd = "GBPNZD", usdchf = "USDCHF"; 

int ticketeurusd = OrderSend (eurusd, OP_BUY, 0.01, Ask, 5, 0, 0, eurusd, 1, 0, clrNONE); 
int ticketeurjpy = OrderSend (eurjpy, OP_BUY, 0.01, Ask, 5, 0, 0, eurjpy, 2, 0, clrNONE); 
int ticketusdcad = OrderSend (usdcad, OP_BUY, 0.01, Ask, 5, 0, 0, usdcad, 3, 0, clrNONE); 
int ticketgbpnzd = OrderSend (gbpnzd, OP_BUY, 0.01, Ask, 5, 0, 0, gbpnzd, 4, 0, clrNONE); 
int ticketusdchf = OrderSend (usdchf, OP_BUY, 0.01, Ask, 5, 0, 0, usdchf, 5, 0, clrNONE); 
}
 

I only work with multi currency ea's.

but you should use OnTimer() as the OnTick() only works for incoming ticks from the chart symbol.

And its not possible in the MT4 backtest only on live market,.

 
Marco vd Heijden:

I only work with multi currency ea's.

but you should use OnTimer() as the OnTick() only works for incoming ticks from the chart symbol.

And its not possible in the MT4 backtest only on live market,.

Ok thanks marko
But why OnTimer()   ??
 

Otherwise the robot will only process on a tick coming in from the chart symbol.

Say you run on EURUSD then the code will only be executed whenever a tick comes in for EURUSD.

Not good so you run OnTimer() to keep it going over SymbolsTotal().

 
Marco vd Heijden:

Otherwise the robot will only process on a tick coming in from the chart symbol.

Say you run on EURUSD then the code will only be executed whenever a tick comes in for EURUSD.

Not good so you run OnTimer() to keep it going over SymbolsTotal().

Ok seems very closed to use the OnTimer or the OnTick Twice will give same results


Do u have a solution for the history center that has a limited periods ...
Do u know from where these people are doing back test for over than 10 years in 15m or 30m chart !

I only found less than a year available for each pair in 15m chart
 
Marco vd Heijden:

Otherwise the robot will only process on a tick coming in from the chart symbol.

Say you run on EURUSD then the code will only be executed whenever a tick comes in for EURUSD.

Not good so you run OnTimer() to keep it going over SymbolsTotal().

Mr Marco
Seems you are an expert

can help me to code a simple script for HEDGE
 
Mitsubishi4arab:
Mr Marco
Seems you are an expert

can help me to code a simple script for HEDGE

We do not have a clear description of what it is you want to do.

If you want to diversify risk by automatically opening up a hedged counter position, which can be a good thing,

You let the EA listen for orders and upon sensing a new order, have it open up the additional position.

 
Mohammad Soubra:
Ok seems very closed to use the OnTimer or the OnTick Twice will give same results


Do u have a solution for the history center that has a limited periods ...
Do u know from where these people are doing back test for over than 10 years in 15m or 30m chart !

I only found less than a year available for each pair in 15m chart
If you are looking for multiple symbol backtesting, this can only be done in MT5.
 
Marco vd Heijden:
If you are looking for multiple symbol backtesting, this can only be done in MT5.
Really ???
THANKS man 



Good information
I dont know before
 
NINJA Marco
U r Ninja
 
Marco vd Heijden:

We do not have a clear description of what it is you want to do.

If you want to diversify risk by automatically opening up a hedged counter position, which can be a good thing,

You let the EA listen for orders and upon sensing a new order, have it open up the additional position.

Have code ?
Reason: