Join our fan page
- Views:
- 3335
- Rating:
- Published:
- 2025.02.21 09:07
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
The algorithm
At every bar the indicator checks all SMA periods ranging from MIN_PERIOD to MAX_PERIOD to find which one caused the most recent bounce(either up or down). If nothing found it leaves that bar empty.
What is the purpose?
The indicator is meant to detect market momentum. Wherever you find both upper and lower line to be non-empty you expect range bound behaviour.
Too much processing needed
The indicator requires heavy processing. So choosing too wide ranges of MA period to be scanned for larger lookback bars or changing SMA to more sophisticated MA methods will cause the indicator to load too late. Anyway when loaded you will have to update latest bar only.

A simple starting-point script to collect data and send to a CSV in oldest-newest ordering. In this example only the close price data is collected.

PrintXYZ() library to print massive information from the terminal.

These are some #define statements that are useful to perform operations in your EA. You only need to assign the name of your variables at the beginning of the file, and then let the other #define statements do the work. In order to use this file, add #include <DEFINE_statements.mqh> to the first line in your EA file.

Download all the ticks from your broker for all the symbols in the market watch. Download all history or until a specific date in the past if available.