Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Scripts

Volume Average Groups For Comparison - script for MetaTrader 5

Pablo Maruk
Published by:
Pablo
Views:
2281
Rating:
(7)
Published:
2023.04.22 20:17
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

You can use this piece of code to set two different groups of volume and compare them.

E.G (one minute chart example):

If you set group 1 to 20.
Group 1: The last 20 bars volume / 20  = You get the average of the last 20 bars.

If you set group 2 to 60.
Group 2: The 21th bar up to 60. (it means you will have 40 bars, not 60, if you want 60 you should set it to 80).

Then, with the average of the last 20 bars and the average of the 21th to 60th bar you can subtract and see the difference between them, or even better, you can divide GROUP 1 / GROUP 2 and see how much the volume has increased.
Such strategy is fantastic to trade 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 the ones who are learning mql5 and want to improve their algo trading skills. Worth downloading for studies purposes.

The return of the function will be called and displayed as a comment on the top of the chart.

    Benchmark Benchmark

    A set of macros to benchmark small code snippets for their execution speeds.

    Money Management Money Management

    Close trades when the percentage profit or risk of the account is reached

    ChartButton Class MT5 ChartButton Class MT5

    This class allows you to create buttons on the chart as if they were chart objects(have time and price coordinates) these objects can be dragged on the chart and when scrolling they stay at the same place. If you wan't to learn some Object Oriented Programming or if you wan't to understand how chartevents work or you wan't to create graphical interfaces, you can learn a lot from this.

    Multi BuyOrders Multi BuyOrders

    To assist traders who wish to open multiple buy orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Buy is the number trades the trader wish to open instantly. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple buy orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.