iMA EA with correlation system

 

Hi there,


I need some help. I play with correlation between EURUSD and GBPUSD. If they are with different fast and slow MA constellation I open one trade per pair with same MagicNumber.

I thought the coding is right but it opens no trades. Can someone help please?


Regards,

Jimbofx7

Files:
ima_corr.mq4  6 kb
 

You don't adjust your slippage for 4/5 digits.

You don't test to see if your OrderSend has worked, always test return values and if it has failed report the error so next time you know why it failed . . . same for OrderClose, here you store the return value in a variable called result, if it is false you Sleep, why not also Print the error ?

TP and SL set to NULL . . . . is NULL valid for SL & TP ? it might work but it's bad practice, if you want toe set SL & TP to 0 then set them to 0.0

Print the values of your MAs to see if they are such that an order should actually be taken.

 
jimbofx7:

Γεια σου,


Χρειάζομαι κάποια βοήθεια. Παίζω με την συσχέτιση μεταξύ EURUSD και GBPUSD. Αν είναι διαφορετικά με γρήγορη και αργή αστερισμό ΜΑ ανοίξω ένα εμπόριο ανά ζεύγος με το ίδιο MagicNumber.

Σκέφτηκα ότι η κωδικοποίηση είναι σωστή, αλλά δεν ανοίγει συναλλαγές. Μπορεί κάποιος να με βοηθήσει παρακαλώ;


Φιλικά,

Jimbofx7

Try this code...

EA working, stay to cross iMA

Files:
 
jimbofx7:

Hi there,


I need some help. I play with correlation between EURUSD and GBPUSD. If they are with different fast and slow MA constellation I open one trade per pair with same MagicNumber.

I thought the coding is right but it opens no trades. Can someone help please?


Regards,

Jimbofx7


thanks a lot! I´ll try.


Kind regards

Reason: