Help please! how to write code lines for an indi(scanner) to work on different pairs & multi timeframes

 
Hello Pro Coders,
Im aPhong, new to FX & Im learning coding as well.

Could anyone share a MQ4 file of whatever scanner you have like Pinbar , Harmonic ... scanner that will work on different pairs & multi timeframes without loading lots of charts?

Im tring to code simple Pinbar scanner but after a lot of research, I still dont know how to write code lines for a indi to work on different pairs & multi timeframes, so really need resources to study!!!
Hope you guys help me!

Thanks in advance

regards,
Phong
 

Have you tried writing it for an EA that simply calls the indi several times but with a different symbol/setting ?

 
Marco vd Heijden:

Have you tried writing it for an EA that simply calls the indi several times but with a different symbol/setting ?Hi

Hi Marco, Nice to know you! 

No, I haven't tried any EA or written codes for an EA. In fact, Im trying to teach myself mql4 & to write a simple Pinbar scanner.

I know there are lots of stuffs to learn in coding... :)

 
In that case i recommend MQL5.
 
Marco vd Heijden:
In that case i recommend MQL5.
I will second that. Go straight to MT5/MQL5.
 

1. Declare arrays for rates and times of last detection for every timeframe.

2. Check if there is a new bar on desired timeframe(s), if yes:

3. Copy necessary rates into predefined arrays and check if copying is successful. If yes:

4. Compare highs/lows/opens/closes/body heights/whatever you wish a pinbar looks like. If it matches your criteria:

5. Check last detection's time, if it doesn't match current bar's:

6. Make it pop up an alert or play a sound or create some chart object or change the background into red or whatever you want.

7. Update the last detection's time for the timeframe.

8. After your indicator starts working right try to optimize it - compact it into as few as possible operations and as few as possible lines. Not counting empty space, of course, you should have a lot of it as it makes reading and writing easier. If you doubt something make it Print what it's doing.

 
kypa:

1. Declare arrays for rates and times of last detection for every timeframe.

2. Check if there is a new bar on desired timeframe(s), if yes:

3. Copy necessary rates into predefined arrays and check if copying is successful. If yes:

4. Compare highs/lows/opens/closes/body heights/whatever you wish a pinbar looks like. If it matches your criteria:

5. Check last detection's time, if it doesn't match current bar's:

6. Make it pop up an alert or play a sound or create some chart object or change the background into red or whatever you want.

7. Update the last detection's time for the timeframe.

8. After your indicator starts working right try to optimize it - compact it into as few as possible operations and as few as possible lines. Not counting empty space, of course, you should have a lot of it as it makes reading and writing easier. If you doubt something make it Print what it's doing.

Thank you so much for your help, Kypa! I think I get it! I will try

But How about checking signal for different pairs in marketwatch ? Could you give me some idea or function names?, so I can study more :)

Have a good day!

...........

btw, Thanks the others too! 

Regards,

Reason: