I have spent three years trading the Forex market and using eSignal
as my charting service. With a background as a developer, I started writing
indicators using the eSignal programming language EFS which I have decided
to share in hopes others can find some use for them. Since I didn't plan
on sharing the code while writing the indicators, none of the files are
commented, however I will try to add an explanation for every file I post.
Feel free to download the indicators and use them as is, or alter them for
your specific needs.
*Important - This Library file is required by the other files in this document.
Place it in your "program files/eSignal/FunctionLibrary" directory.
The Library file consists of "objects" that I created which simplify the
development of indicators and allows for the reuse of code which reduces
the effort and time required to write them.
Draws trendlines on the chart according to the current interval (i.e. draws
a 15 trendline on a 15 minute chart and a 60 minute trendline on a 60 minute
chart). Allows the user to change the line style, line thickness and line
color of the Trendline.
* Requires Library File
Draws a 15 Minute trendline on a chart with an interval of 15 minutes or
less. Allows the user to change the line style, line thickness and line
color of the Trendline.
* Requires Library File
Draws a 60 Minute trendline on a chart with an interval of 60
minutes or less. Allows the user to change the line style, line
thickness and line color of the Trendline.
* Requires Library File
Draws trendlines for 5 minute, 15 minute, 60 minute, 240 minute and daily
intervals. Allows the user to turn on and off trendlines, change the line
style, line thickness and line color of the trendlines. Defaults to 15
minute and 60 minute trendlines on and the other trendlines off. Visible
on charts with intervals equal to or less than the trendline( i.e. 60
minute trendline will only display on a 60 minute chart or less).
* Requires Library File
Draws daily pivot points using midnight to midnight Eastern Standard Time.
Adjusts to different timezones so the pivots will always show up according
to eastern time.
* Requires Library File
Draws daily pivot points using midnight to midnight Eastern Daylight Savings
Time. Adjusts to different timezones so the pivots will always show up
according to eastern time.
* Requires Library File
Draws the weekly pivot points as solid blue lines and the midpoints as
dashed blue lines. Labels the end of the pivot points and places a box
around the label.
* Requires Library File
Draws the main monthly pivot point as a solid red line and the remaining
pivot points and midpoints as dashed red lines.
* Requires Library File
Displays a color coded version of the CCI. Displays green when price is
above the 34 EMA and CCI is greater than zero, displays red when price
is below the 34 EMA and CCI is less than zero,otherwise displays blue.
The magenta line is a second CCI with the length of 6.
* Requires Library File
if (vInit = = true) {
if (vLib = = null) vLib = addLibrary("luigisindicators.efsLib");
if (vInv = = null) vInv = new vLib.Chart( getSymbol() ,getInterval());
if (vMA5 = = null) vMA5 = vInv.ma5;
if (vMA8 = = null) vMA8 = vInv.ma8;
vInit = false;
}
The above piece of code shows how the library file can be used. We first initialize the library file and assign it to the vLib variable. Next we create a new Chart object, which is defined within the the library file, and assign it to the variable vInv. The variables vMA5 and vMA8 are then assigned to the ma5 and ma8 objects, which are created as part of the chart object.
if (vMA5.emaPosX(vMA8) &&
vInv.ma34.aboveEMA()) {
vStop = close() - (stopP * 0.0001);
goLong();
In the above code we check for a positive 5 EMA crossover of the 8 EMA and check if price is above the 34 EMA. If both conditions are true we set a stop and go long.
* Requires Library File
if (vInit == true) {
if (vLib == null) vLib = addLibrary("luigisindicators.efsLib");
if (v60 == null) v60 = new vLib.Chart( getSymbol() ,60 );
if (v15 == null) v15 = new vLib.Chart( getSymbol() ,15 );
vInit = false;
}
In the above code, we create a new 60 minute chart object and a new 15 minute chart object, and assign them to the variables v60 and v15. This allows us to use two different time intervals when doing our backtesting.
if ( v60.cci14.upTrend() && v60.cci14.wtMoRev() &&
!v60.cci14.ctExtreme(5) && v15.cci14.angle() > 0) {
vStop = close() - (stopP * 0.0001);
vTarget = close() + (targetP * 0.0001);
goLong();
This piece of code checks for a 60 minute cci uptrend, a 60 minute cci momentum reversal in the direction of the trend, checks that the 60 minute cci has not entered the negative extreme territory in the last 5 bars, and the 15 minute cci is increasing. If all the conditions are met we set a stop and a target and go long.
* Requires Library File
if (vInit == true) {
if (vLib == null) vLib = addLibrary("luigisindicators.efsLib");
if (v60 == null) v60 = new vLib.Chart( getSymbol() ,60 );
vInit = false;
}
This time we just create a new 60 minute chart object.
if ( v60.cci20.upTrend() && v60.cci20.wtMoRev() &&
!v60.cci20.ctExtreme(5) ) {
vStop = close() - (stopP * 0.0001);
vTarget = close() + (targetP * 0.0001);
goLong();
We test for a 60 minute cci uptrend, a 60 minute cci momentum reversal in the direction of the trend, and check that the 60 minute cci has not been in the negative extreme in the last 5 bars. If all conditions are satisfied, we set our stop and target and go long.
* Requires Library File
if (vInit == true) {
if (vLib == null) vLib = addLibrary("luigisindicators.efsLib");
if (v15 == null) v15 = new vLib.Chart( getSymbol() ,15 );
if (v5 == null) v5 = new vLib.Chart( getSymbol() ,5 );
vInit = false;
}
Here we create a 15 minute chart object and a 5 minute chart object.
if ( v15.cci14.downTrend() && v5.cci14.downTrend() &&
v5.cci14.wtExtreme()) {
goShort();
We test for a 15 minute cci downtrend, a 5 minute cci downtrend and the 5 minute cci to enter the negative extreme territory. If all conditions are satisfied we go short.
* Requires Library File