| / | Forum |
|
lalilo
2007.03.10 16:53
I am trying to test multiple pairs and once a signal occurred on one pair, an order
is sent.
I use MA as entry signal, so instead of writing iMA (which I need 5 MAs for one pair) on each individual pair, I use this code to switch between pairs. string currency; int ss; if(ss == 0) currency = "EURCAD"; if(ss == 1) currency = "USDJPY"; if(ss == 2) currency = "GBPUSD"; if(ss == 3) currency = "AUDUSD"; if(ss == 4) { currency = "USDCAD"; ss = -1; } ss++; for each tick, "currency" has different value. My questions are: Is there any way to do this? when I test it on my live account, the value of "currency" is random and it doesn't go by that order, why? when I test this on the Tester, it doesn't send any order, why? Thanks, |
|
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization This article dwells on implementation algorithm of simplest trading systems. The article will be useful for beginning traders and EA writers. |
|
irusoh1
2007.03.10 19:23
The best thing to have separate EA for each pair. EAs are executed when tick comes
in for the chart. If using pair other than the chart you may miss a tick or execute
several times on the same tick of the other pair. If you want to stop sending orders
when one pair got one, set global variable to true and have check it befiore sending
orders. This called semaphore. You check for red light before you go.
|
33780 |
Rosh
2007.03.11 10:13
|
|
lalilo
2007.03.11 11:55
Thanks for the input.
I forget a word in my question above, "Is there any way to do this", which I meant "Is there any OTHER way to do this?" if I run the EA on different currencies, how the EA is going to read function like, OrdersTotal() (all open orders or just open orders for that currency)? Is there an article to read about opening the same EA on different currencies (or maybe different timeframes)? |
33780 |
Rosh
2007.03.11 12:32
OrdersTotal() returns numer of ALL orders (open and pending on ALL Symbols ) on current account.
|
|
lalilo
2007.03.20 18:48
how about if I save the same EA on different names and run each EA on different
pairs ? |
33780 |
Rosh
2007.03.20 19:18
Especially for those purposes exist such excellent feature as MagicNumber !
|