Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Volume Average Groups for Comparison - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources

author EAcpu | 4 reads | 0 comments |

You can use this code to set two different sets of volumes and compare them.

EG (one minute chart example):

If group 1 is set to 20.
Group 1: Volume of the last 20 bars / 20 = You get the average of the last 20 bars.

If group 2 is set to 60.
Group 2: Measures 21 to 60. (This means you will have 40 bars instead of 60, if you wanted 60 you should set it to 80).

You can then subtract the average of the last 20 bars and the average of bars 21 to 60 and see the difference between them, or better yet, you can divide by GROUP 1 / GROUP 2 and see how much the volume has increased.
This strategy is great for trading breakouts or trend following.

You can combine volume analysis with price action.

So this is a very clean and simple piece of code, but valuable for those who are learning mql5 and want to improve their algorithmic trading skills. Worth downloading for learning purposes.

The return of the function will be called and shown as a comment at the top of the chart.


Attachment download

📎volumeaveragegroups.mq5 (1.83 KB)

Source: MQL5 #44007

Verification code Refresh