Another EL Learning Exercise - EasyLanguage Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming

Another EL Learning Exercise
Started:April 10th, 2016 (02:09 PM) by TrendFirst Views / Replies:125 / 1
Last Reply:April 10th, 2016 (02:09 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Another EL Learning Exercise

Old April 10th, 2016, 02:09 PM   #1 (permalink)
Trading Apprentice
Calgary AB Canada
Futures Experience: Intermediate
Platform: Multicharts, IQFeed
Broker/Data: Interactive Brokers, Fidelity, Questrade
Favorite Futures: Forex, Options, Futures, Stock
Posts: 8 since Jan 2016
Thanks: 2 given, 0 received

Another EL Learning Exercise

I'm continuing down the path of learning EL, starting by exploring some of the indicators included with MultiCharts. When I saw one labeled "Elder Triple Screen", I thought "Well this might be an easier one for me to understand, since I have Elder's original book". So I started reviewing it.

While I'm thankful that MC included indicator code with the software package, I have to say that their Elder Triple Screen is, well, not really a triple screen. The original triple screen worked on three time frames, hence the name. The MC Triple Screen works on one time frame. It does use two screens, the slope of an EMA line and the slope of the MACD Histogram, to paint bars.

I'm not an expert on the history of EL by any means, but it seems to be coded with an older version of EL. I also found their variable-naming convention confusing. Here is my code, using different nomenclature that makes more sense to me.

{ ------------------------------------------------------------------------------------------
 A bit of practice here, along with "correcting" one of the existing MC indicators,
 which they called Elder Triple Screen.  It's not - it's not even close to the
 original ETS.  So I'm renaming it and re-coding it, using nomenclature that makes
 more sense to me.  MC used variable names that didn't seem logical to me.
 I'm calling this the MACD_EMA Double Screen.  One time frame, two screens. Next step
 will be doing a proper Elder Triple Screen that actually uses three time frames.
 How this works:
 If MACD Histogram slope is up and EMA slope is up, bars are painted green.
 If MACD Histogram slope is down and EMA slope is down, bars are painted red.
 If the slopes point in opposite directions, bars are painted yellow.
 ------------------------------------------------------------------------------------------- }
 	UpColor   (Green),      // Paintbar colors used
 	DownColor (Red),
 	FlatColor (Yellow),
 	FastEMAPeriod (12),     // Fast period used to calculate MACD
 	SlowEMAPeriod (26),     // Slow period used to calculate MACD
 	SignalPeriod   (9),     // EMA period used for calculating the Signal Line
 	EMAPeriod     (26),     // Exponential moving average period for calculating EMA slope
 	MACDPrice     (Close);  // Closing price is used in the calculations
 	MACDLine      (0),      // MACD line, also known as fast line, usually solid color
 	SignalLine    (0),      // Signal line, also known as slow line, usually dashed line
 	Histogram     (0),      // Histogram bars, which are MACDLine - SignalLine
 	EMALine       (0),      // Exponential Moving Average
 	PlotColor     (0);
 EMALine    = Xaverage (Close, EMAPeriod);
 MACDLine   = (MACD (MACDPrice, FastEMAPeriod, SlowEMAPeriod));
 SignalLine = Xaverage (MACDLine, SignalPeriod);
 Histogram  = MACDLine - SignalLine;
 If (( EMALine > EMALine[1]) and (Histogram > Histogram[1])) then begin
 	PlotColor    = UpColor;
 Else If (( EMALine < EMALine[1]) and (Histogram < Histogram[1])) then begin
 	PlotColor    =  DownColor;
 Else If (((EMALine <= EMALine[1]) and (Histogram >= Histogram[1]))
	or (EMALine >= EMALine[1]) and Histogram <= Histogram[1]) then begin
	PlotColor    = FlatColor;
 PlotPaintBar (High, Low, Open, Close, "MACD_EMA Double Screen", PlotColor);

And here is the old code for comparison:

{ 27499 }

{Title:  Alexander Elder Triple Screen: Initial Screen for Trading Prospects


1.  Paint the bar green when the EMA and the MACD histogram each turn up.       Possible long setup.
2.  Paint the bar red when the EMA and the MACD histogram each turn down.      Possible short setup.
3.  Paint the bar yellow when the EMA and the MACD go in different directions.  No trade setup.


      LongColor(Green),         {Paintbar color for possible long}
      ShortColor(Red),         {Paintbar color for possible short}
      NoActionColor(Yellow),      {Paintbar color for noaction}
      MACDPrice(Close),         {MACD Price value used in calculation}
      MACDExpMALength(9),      {MACD Smoothing Exponential Moving Average Length}
      MACDFastLength(12),      {MACD Fast length value used in calculation}
      MACDSlowLength(26),      {MACD Slow length value used in calculation}

      MALength(26);         {Moving average length}

      AlertMessage(""),         {Content of Alert Message}
      PlotColor(0),         {Color to be plotted}
      PlotMessage(""),         {Message to be plotted}

      MACDDiff(0),         {MACD Difference used to plot MACD histogram}
      MAValue(0),         {Current moving average value}
      MACDValue(0),         {Current MACD value}
      OldMACDDiff(0),         {Prior MACD Diff Value to which current will be compared}
      OldMACDValue(0),         {Prior MACD value to which current will be compared}

      OldMAValue(0);         {Prior Moving average value to which current will be compared}

      OldMAValue=MAValue;      {Capture old moving average value before calculating new}

      OldMACDDiff=MACDDiff;      {Capture old MACD Diff value before calculating new}
      OldMACDValue=MACDValue;      {Capture old MACD value before calculating new}
      MACDValue=MACD(MACDPrice, MACDFastLength,MACDSlowLength);
      MACDAvg=Xaverage(MACD(MACDPrice, MACDFastLength,MACDSlowLength),MACDExpMALength);
      MACDDiff=(MACDValue-MACDAvg);   {MACDDiff is the diffe between MACD  and MACD Exp Value}

      If ((MAValue > OldMAValue) and (MACDDiff > OldMACDDiff)) then
            PlotColor=LongColor ;

      If ((MAValue < OldMAValue) and (MACDDiff < OldMACDDiff)) then
            PlotColor=ShortColor ;

If ((MAValue <= OldMAValue) and (MACDDiff >= OldMACDDiff)) or ((MAValue >= OldMAValue) and (MACDDiff <= OldMACDDiff)) then

      PlotPaintBar(High,Low,Open,Close, "Elder Screen", PlotColor) ;
      Alert( AlertMessage ) ;

Reply With Quote

Old April 10th, 2016, 02:09 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > Another EL Learning Exercise

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With An EL Learning Exercise TrendFirst EasyLanguage Programming 6 March 19th, 2016 02:48 PM
Coin Flip Exercise Java Traders Hideout 8 December 29th, 2014 09:47 PM
Learning how to play guitar...reminds me of learning how to trade shodson Beginners and Introductions 10 September 16th, 2013 05:22 PM
My “Focus Meditation” Exercise AttitudeTrader Psychology and Money Management 13 July 17th, 2012 09:22 AM
Learning EL. Question Timot EasyLanguage Programming 13 May 12th, 2012 09:41 AM

All times are GMT -4. The time now is 06:40 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-24 in 0.08 seconds with 20 queries on phoenix via your IP