Questions for programmers

To add comments, please log in or register
wolfe
1037
wolfe  

Hello everyone,

I would like to start this thread, and have it be a place for anyone to go if they have a mq4 programming question or problem.

My hope is that ALL you expert programmers out there will attempt to answer any questions that anyone has posted in this thread.

There are many great programmers in this forum that seem happy to help people with their programming. The Ask thread started by Codersguru is one great place for people to go with questions.

If anyone has any coding questions, feel free to post them in this thread and hopefully one of the many great programmers will be happy to help.

wolfe
1037
wolfe  

I would like to start this off with a coding question of my own.

I am writing an expert that involves opening many different pairs from one chart.

My question is this: We all know that your expert will only read through your code when an incoming tick happens in the chart that your expert is attached to. Is there a way to make your expert execute if there is an incoming tick from a different currency pair on a separate chart? I have not been able to figure out if this is possible. Thank you to anyone that has a solution for this problem.

Guyver
1152
Guyver  
wolfe:
I would like to start this off with a coding question of my own.

I am writing an expert that involves opening many different pairs from one chart.

My question is this: We all know that your expert will only read through your code when an incoming tick happens in the chart that your expert is attached to. Is there a way to make your expert execute if there is an incoming tick from a different currency pair on a separate chart? I have not been able to figure out if this is possible. Thank you to anyone that has a solution for this problem.

well if you like to see the code in action then please take a look at TSD EA's in Expert advisor section the new ones are trading all the currencies by attaching it to only in one chart.

hope this help

wolfe
1037
wolfe  
Guyver:
well if you like to see the code in action then please take a look at TSD EA's in Expert advisor section the new ones are trading all the currencies by attaching it to only in one chart. hope this help

I know how to execute multi-currency trades from one chart. But does the code allow for the program to be executed if ANY of the currencies have a NEW tick, not JUST the tick from the chart your EA is attached to? If this has been programmed, can you give an example? Thanks!

Michel
476
Michel  
wolfe:
I know how to execute multi-currency trades from one chart. But does the code allow for the program to be executed if ANY of the currencies have a NEW tick, not JUST the tick from the chart your EA is attached to? If this has been programmed, can you give an example? Thanks!

Please, check this: A question for the MQ developers - how to trigger the tick? - Forex Trading Software Forum

I think you can have some small EA on each pair to trigger the main EA (or a DLL), but I never tried it.

wolfe
1037
wolfe  
Michel:
Please, check this: A question for the MQ developers - how to trigger the tick? - Forex Trading Software Forum I think you can have some small EA on each pair to trigger the main EA (or a DLL), but I never tried it.

Thank you for the information. I'm not sure this will work, but I will try it. I just need a way to make the EA go through the int start() function if ANY tick comes in from ANY of the currencies my EA is managing. It seems there should be a piece of code you could write into the EA that would allow this to happen.

Michel
476
Michel  
wolfe:
Thank you for the information. I'm not sure this will work, but I will try it. I just need a way to make the EA go through the int start() function if ANY tick comes in from ANY of the currencies my EA is managing. It seems there should be a piece of code you could write into the EA that would allow this to happen.

Normally (ie without the use of PostMessage etc) the start() function of an EA is only called by a new tick of the pair which the EA is attached to.

So the EA is able to know if another pair has receive a new tick using MarketInfo() or iClose() etc, but this knowledge can only happen inside the start() func of the EA, ie when a new tick of the first pair arrives.

To be free of the triggering of the start() func, you can write an endless loop script which scan for sample every 100 ms the value given by MarketInfo() or better, some flag as GlobalVariables writen by small EAs attached to each pair.

wolfe
1037
wolfe  

Thank you michel, I will continue to work on this.

wolfe
1037
wolfe  

Maybe best to just attach EA to currency pair that is most active. GBPJPY? Could attach to most active pair whether I'm trading that pair or not just to get int start() to cycle more frequently.

To add comments, please log in or register