Just Waves

Among various methods of technical
analysis of the Forex market, wave analysis used to be the basic one.
Anyway, when it comes to the price change over a period of time, we are
dealing with waves. According to Elliott's theory, waves are formed in a
fractal way. On the same principle MT4 indicator "Just Waves" marks up
waves of different levels (up to 8) and creates graphic lines that indicate
the beginning and ending points of the waves.

"Just
Waves" offers an objective criterion of a wave, thereby uncovering
tremendous opportunities not only for traders but also for programmers,
developers of trading systems and analyzers. It was created in order to
help people get rid of routine actions the robot is able to do as
much as possible, and focus attention on the decision-making process.

Settings

Level - number of wave levels (0-7)

WaveName - the major name of a single wave (default "Wave")

VLine - if true, the indicator starts working from the bar, which has a vertical line

VLineName - name of the vertical line (default "1")

SelectableWaves -opportunity to remove the selection by clicking waves and to hide them from the list of objects.

WavesOnBackground - opportunity to draw waves in the background.

Mode: - 0: waves are drawn based on a fixed timeframe - 1: waves are drawn based on the current timeframe

You can also set the color and width of the wave lines.

Code example for waves counting:

#property version"1.00"externint Level=7; // how much levels do you wantexternstring Name2="Wave"; // major name of drawing wave linesexternbool VLine=false; // Vlineexternstring Name1="1"; // Nameexternstring ind_name="Market\just-waves"; // Just Waves's indicator name in "MQL4/Indicators" folderint i6[]; // Total waves amount// Compile it into /mql4/Experts folder// Current Expert Adviser works only with "Just Waves" Indicator// The script helps to get total waves amount and stores it into i6[]// in order later to get easily access to Vertical lines and get data from it// such as Date1,Price1,Date2,Price2, which means the Start and the End of// a single wave// Sometimes, on the history only, "Just Waves 1.00" is missing to create one// wave of the least wave level in the chain of waves// In order to avoid this non-critical bug there is i4 integer// checks if there is one more wave after missing one and if true// continues counting wavesintOnInit()
{
//---ArrayResize(i6,Level+1); // prepare i6 for work //---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
string coment;
iCustom(NULL,0,ind_name,Level,Name2,VLine,Name1,0,0);
for(int y=Level;y>=0;y--) // circle for levels
{
int i2=0,i3=0,i4=0;
for(int i=0;;i++) // circle for waves of each level
{
int i5=i+1; // i5 is number of the next wave after i
i2=ObjectFind(0,y+Name2+i); // returns >=0 if y+wave+i exists
i4=ObjectFind(0,y+Name2+i5); // returns >=0 if y+wave+i+1 existsif(i2<0 && i4<0) // stop if there are no waves anymore
{
i3--;
break;
}
i3++; // i3 counts total amount of waves for the level
}
i6[y]=i3; // when counted global int i6[] stores it
coment=coment+"Lvl_"+y+" - "+i6[y]+"\n";
Comment(coment);
}
}
//+------------------------------------------------------------------+

Video

Added ability to change the operation mode (Mode):
- 0: waves are drawn based on a fixed timeframe
- 1: waves are drawn based on the current timeframe

Version 1.1
2015.03.24

- 20 times faster initialization
- switching between timeframes/accounts implemented
- one tick drawing lag fixed
- new settings added:
1. SelectableWaves - opportunity to remove the selection by clicking waves and to hide them from the list of objects.
2. WavesOnBackground - opportunity to draw waves in the background