# GetElliottStudy

ICE Data Services -

Creates object which allows to get values of indicator Advanced GET Elliott Waves in EFS scripts. Elliott Waves, the "E" part of GET (Gann Elliott Trader), is one of the core studies of GET. The simplified Elliott Wave theory states that you will have a 5 wave sequence in a direction, some kind of corrective pattern (most of the time), and then a new 5 wave sequence in the opposite direction.

Syntax
GetElliottStudy( nNumBars , nPct4Overlap , nPct1LenOf3 , nMavg1 , nMavg2 , Alternate )

Parameters
 Parameter: Description:
 nNumBars Number of Bars to calculate Elliott Waves nPct4Overlap The percentage that Wave 4 can overlap Wave 1 before the Wave count is considered invalid and has to be recalculated. The default for any Futures contract is 17% (to account for slippage) and 0% for all other issues. nPct1LenOf3 The maximum percent-level of the length of Wave 3 that the Wave 1 can be labeled. This percentage is important in the way the Wave 4 time channels and PTI are calculated. The default Wave 1-3 ratio is 50%. This means if you take the length of Wave 3, the Wave 1 could be labeled anywhere up to 1/2 the length of Wave 3. This does not mean that it will be labeled right at the 50% mark, but it could be labeled anywhere from the 1% up to the 50% level according to this percentage. If you decrease this number to 20%, this means that the Wave 1 has to be labeled somewhere between 1% and 20% of the length of Wave 3. nMavg1 Number of periods to use for calculation of the first MA. nMavg2 Number of periods to use for calculation of the second MA. Alternate Boolean

Member(s)
 Syntax: Returned value:
 GetElliottStudy.PTI Returns the PTI value GetElliottStudy.W5PROJECTION1GetElliottStudy.W5PROJECTION2 Return the values of the two wave 5 projections. (The wave projections are marked on the chart with a number enclosed by dashes eg -5- or -4-). GetElliottStudy.WAVE Returns the following [on the bar on which the wave is identified) 1, 2, 3, 4 and 5 for up waves 1 through 5 and corresponding negative values for down waves 1 through 5 7, 8, 9 for up waves A, B and C and corresponding negative values for down waves A, B and C GetElliottStudy.MINORWAVE Returns the following [on the bar on which the wave is identified) 1, 2, 3, 4 and 5 for minor up waves i, ii, iii, iv, v and corresponding negative values for minor down waves i, ii, iii, iv, v 7, 8, 9 for minor up waves a, b and c and corresponding negative values for minor down waves a, b and c GetElliottStudy.INTEMEDIATEWAVE Returns the following [on the bar on which the wave is identified) 1, 2, 3, 4 and 5 for intermediate up waves 1 through 5 and corresponding negative values for intermediate down waves 1 through 5 7, 8, 9 for intermediate up waves A, B and C and corresponding negative values for intermediate down waves A, B and C GetElliottStudy.MOSTRECENTWAVE GetElliottStudy.MOSTRECENTMINORWAVEGetElliottStudy.MOSTRECENTINTERMEDIATEWAVE Return the value of most recent complete wave, minor wave, intermediate wave corresponding. GetElliottStudy.MOSTRECENTWAVEBARINDEXGetElliottStudy.MOSTRECENTWAVEMINORBARINDEXGetElliottStudy.MOSTRECENTWAVEINTERMEDIATEBARINDEX Return the bar index where most recent wave (minor wave, intermediate wave) is completed.

Notes
Only available in versions 7.9 or later.
This function is not [yet] supported in versions 11.X
Note that in streaming mode values returned by GetElliottStudy() are actual only for last bar

Code Example
Labels of Projection 1 and Projection 2:
 `function preMain() { setPriceStudy(true); setStudyTitle("wave 5 Projections"); setShowCursorLabel(false);}var ElliottWave = new GetElliottStudy(300, 0, 50, 5, 35, 0);function main() { var nWaveProj5_1 = ElliottWave.getValue(GetElliottStudy.W5PROJECTION1); var nWaveProj5_2 = ElliottWave.getValue(GetElliottStudy.W5PROJECTION2); if(nWaveProj5_1 == null||nWaveProj5_2 == null) return; drawTextRelative(3, nWaveProj5_1, formatPriceNumber(nWaveProj5_1), Color.blue, null, Text.VCENTER|Text.BOLD, "Arial", 11, "Proj1"); drawTextRelative(3, nWaveProj5_2, formatPriceNumber(nWaveProj5_2), Color.blue, null, Text.VCENTER|Text.BOLD, "Arial", 11, "Proj2"); return;}`

Labels For Main Elliott Waves:
 `function preMain() { setPriceStudy(true); setStudyTitle("wave ColorBgBar"); setShowCursorLabel(false);}var ElliottWave = new GetElliottStudy(300, 0, 50, 5, 35, 0);function main() { var nWave = ElliottWave.getValue(GetElliottStudy.WAVE); debugPrintln(getCurrentBarIndex()+" "+nWave); if (nWave==1) setBarBgColor(Color.RGB(221,254,204)); if (nWave==2) setBarBgColor(Color.RGB(105,254,33)); if (nWave==3) setBarBgColor(Color.RGB(47,221,20)); if (nWave==4) setBarBgColor(Color.RGB(49,148,0)); if (nWave==5) setBarBgColor(Color.RGB(27,85,0)); if (nWave==-1) setBarBgColor(Color.RGB(255,212,212)); if (nWave==-2) setBarBgColor(Color.RGB(255,161,161)); if (nWave==-3) setBarBgColor(Color.RGB(255,100,100)); if (nWave==-4) setBarBgColor(Color.RGB(255,10,10)); if (nWave==-5) setBarBgColor(Color.RGB(191,0,0)); if (nWave==7) setBarBgColor(Color.RGB(195,195,255)); if (nWave==8) setBarBgColor(Color.RGB(63,63,255)); if (nWave==9) setBarBgColor(Color.RGB(0,0,178)); if (nWave==-7) setBarBgColor(Color.RGB(255,229,89)); if (nWave==-8) setBarBgColor(Color.RGB(242,204,0)); if (nWave==-9) setBarBgColor(Color.RGB(182,154,0)); return;}`

Labels For All Elliott Waves:
 `var fpArray = new Array();function preMain(){ askForInput(); setPriceStudy(true); var x=0; fpArray[x] = new FunctionParameter("nNumBars", FunctionParameter.NUMBER); with(fpArray[x++]) { setName("Number of Bars"); setLowerLimit(1); setDefault(300); } fpArray[x] = new FunctionParameter("nPct4Overlap", FunctionParameter.NUMBER); with(fpArray[x++]) { setName("Wave 4 Overlap"); setLowerLimit(0); setDefault(0); } fpArray[x] = new FunctionParameter("nPct1LenOf3", FunctionParameter.NUMBER); with(fpArray[x++]) { setName("Wave 1-3 Ratio"); setLowerLimit(1); setDefault(50); } fpArray[x] = new FunctionParameter("nMavg1", FunctionParameter.NUMBER); with(fpArray[x++]) { setName("Mavg1"); setLowerLimit(1); setDefault(5); } fpArray[x] = new FunctionParameter("nMavg2", FunctionParameter.NUMBER); with(fpArray[x++]) { setName("Mavg1"); setLowerLimit(1); setDefault(35); } fpArray[x] = new FunctionParameter("gAlternate", FunctionParameter.BOOLEAN); with(fpArray[x++]) { setName("Alternate"); setDefault(false); } }var vElt = null;var i=0;var bInit = false;var labelUp = false;var labelUpMid = false;var labelUpInt = false;function main( nNumBars, nPct4Overlap, nPct1LenOf3, nMavg1, nMavg2, gAlternate ) { vElt = new GetElliottStudy(nNumBars, nPct4Overlap, nPct1LenOf3, nMavg1, nMavg2, gAlternate); var valPTI = vElt.getValue(GetElliottStudy.PTI); var valW5PR1 = vElt.getValue(GetElliottStudy.W5PROJECTION1); var valW5PR2 = vElt.getValue(GetElliottStudy.W5PROJECTION2); var valWAVE = vElt.getValue(GetElliottStudy.WAVE); var valMWAVE = vElt.getValue(GetElliottStudy.MINORWAVE); var valIWAVE = vElt.getValue(GetElliottStudy.INTERMEDIATEWAVE); var valMRWAVE = vElt.getValue(GetElliottStudy.MOSTRECENTWAVE); var valMRIWAVE = vElt.getValue(GetElliottStudy.MOSTRECENTINTERMEDIATEWAVE); var valMRMWAVE = vElt.getValue(GetElliottStudy.MOSTRECENTMINORWAVE); var valMRWBARINDEX = vElt.getValue(GetElliottStudy.MOSTRECENTWAVEBARINDEX); var valMRIWBARINDEX = vElt.getValue(GetElliottStudy.MOSTRECENTWAVEINTERMEDIATEBARINDEX); var valMRMWBARINDEX = vElt.getValue(GetElliottStudy.MOSTRECENTWAVEMINORBARINDEX); var drawingLevel=0; //Minor Waves Drawing printVal = ""; fgColor = Color.blue; print = false; if (Math.abs(valMWAVE)>=1 && Math.abs(valMWAVE)<=5) { if (Math.abs(valMWAVE) == 1) printVal += "I"; if (Math.abs(valMWAVE) == 2) printVal += "II"; if (Math.abs(valMWAVE) == 3) printVal += "III"; if (Math.abs(valMWAVE) == 4) printVal += "IV"; if (Math.abs(valMWAVE) == 5) printVal += "V"; print = true; } if (Math.abs(valMWAVE) >= 7 && Math.abs(valMWAVE) <= 9) { if (Math.abs(valMWAVE) == 7) printVal += "a"; if (Math.abs(valMWAVE) == 8) printVal += "b"; if (Math.abs(valMWAVE) == 9) printVal += "c"; fgColor = Color.red; print = true; } if (print) { labelUpMid = ( Math.abs(valMWAVE) % 2 == 1 && valMWAVE > 0 ) || (Math.abs(valMWAVE) % 2 == 0 && valMWAVE < 0 ); if (labelUpMid) drawTextRelative(0,AboveBar1,printVal,fgColor, null, Text.PRESET|Text.CENTER|Text.BOLD,"Arial",11,i++); else drawTextRelative(0,BelowBar1,printVal,fgColor, null, Text.PRESET|Text.CENTER|Text.BOLD,"Arial",11,i++); drawingLevel++; } //Intermediate Waves Drawing printVal = ""; fgColor = Color.blue; print = false; if (Math.abs(valIWAVE)>= 1 && Math.abs(valIWAVE) <= 5) { if (Math.abs(valIWAVE) == 1) printVal += "1"; if (Math.abs(valIWAVE) == 2) printVal += "2"; if (Math.abs(valIWAVE) == 3) printVal += "3"; if (Math.abs(valIWAVE) == 4) printVal += "4"; if (Math.abs(valIWAVE) == 5) printVal += "5"; print = true; } if (Math.abs(valIWAVE) >= 7 && Math.abs(valIWAVE)<= 9) { if (Math.abs(valIWAVE) == 7) printVal += "A"; if (Math.abs(valIWAVE) == 8) printVal += "B"; if (Math.abs(valIWAVE) == 9) printVal += "C"; fgColor = Color.red; print = true; } if (print) { var Above = AboveBar1; var Below = BelowBar1; if (drawingLevel == 1) { Above = AboveBar2; Below = BelowBar2; } labelUpInt = ( Math.abs(valIWAVE) % 2 == 1 && valIWAVE > 0 ) || (Math.abs(valIWAVE) % 2 == 0 && valIWAVE < 0 ); if (labelUpInt) drawTextRelative(0,Above,printVal,fgColor, null, Text.PRESET|Text.CENTER|Text.BOLD,"Arial",11,i++); else drawTextRelative(0,Below,printVal,fgColor, null, Text.PRESET|Text.CENTER|Text.BOLD,"Arial",11,i++); drawingLevel++; } //Major Waves Drawing var printVal = ""; var fgColor = Color.blue; var print = false; if (Math.abs(valWAVE) >= 1 && Math.abs(valWAVE) <= 5) { printVal = ""+Math.abs(valWAVE); print = true; } if (Math.abs(valWAVE) >= 7 && Math.abs(valWAVE) <= 9) { if (Math.abs(valWAVE) == 7) printVal += "A"; if (Math.abs(valWAVE) == 8) printVal += "B"; if (Math.abs(valWAVE) == 9) printVal += "C"; fgColor = Color.red; print = true; } if (print) { var Above = AboveBar1; var Below = BelowBar1; if (drawingLevel == 1) { Above = AboveBar2; Below = BelowBar2; } if (drawingLevel == 2) { Above = AboveBar3; Below = BelowBar3; } labelUp = ( Math.abs(valWAVE) % 2 == 1 && valWAVE > 0 ) || (Math.abs(valWAVE) % 2 == 0 && valWAVE < 0 ); if (labelUp) drawTextRelative(0,Above,printVal,Color.white, fgColor, Text.PRESET|Text.FRAME|Text.CENTER|Text.BOLD,"Arial",11,i++); else drawTextRelative(0,Below,printVal,Color.white, fgColor, Text.PRESET|Text.FRAME|Text.CENTER|Text.BOLD,"Arial",11,i++); } //PTI Drawing if (valPTI != null) { drawTextAbsolute(5, 0, valPTI, Color.white, Color.red, Text.PRESET|Text.BOLD,"Arial",11,i++); drawTextAbsolute(10, 0, "PTI", Color.red, null, Text.PRESET|Text.BOLD,"Arial",11,i++); } //MostRecentBar Marking drawShapeAbsolute(valMRWBARINDEX,25,Shape.TRIANGLE,null,Color.blue, Shape.PRESET,i++); //Projection Drawing if (valW5PR1 != null) drawTextAbsolute(1,valW5PR1,"-5-",Color.blue,null, Text.ONTOP | Text.CENTER | Text.VCENTER, "Arial",11,i++); if (valW5PR2 != null) drawTextAbsolute(1,valW5PR2,"-5-",Color.blue,null, Text.ONTOP | Text.CENTER |Text.VCENTER, "Arial",11,i++);}`