Another EL Learning Exercise - EasyLanguage Programming | futures io social day trading
futures io futures trading


Another EL Learning Exercise
Updated: Views / Replies:432 / 1
Created: by TrendFirst Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Another EL Learning Exercise

  #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.

 
Code
{ ------------------------------------------------------------------------------------------
 
 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.
 
 ------------------------------------------------------------------------------------------- }
 
 Inputs:
 	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
 	
 Variables:
 	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;
 end
 
 Else If (( EMALine < EMALine[1]) and (Histogram < Histogram[1])) then begin
 	PlotColor    =  DownColor;
 end
 
 Else If (((EMALine <= EMALine[1]) and (Histogram >= Histogram[1]))
	or (EMALine >= EMALine[1]) and Histogram <= Histogram[1]) then begin
	PlotColor    = FlatColor;
 end;
 
 PlotPaintBar (High, Low, Open, Close, "MACD_EMA Double Screen", PlotColor);


And here is the old code for comparison:

 
Code
{ 27499 }

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

Description:

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.

}

{Declarations}
      
   Inputs:
   
      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}


   Variables:
      
      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}
      MACDAvg(0),
      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}


{Procedure}
      
      OldMAValue=MAValue;      {Capture old moving average value before calculating new}
      MAValue=Xaverage(Close,MALength);

      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
         begin
            PlotColor=LongColor ;
            AlertMessage="Long";
         end

      Else
      If ((MAValue < OldMAValue) and (MACDDiff < OldMACDDiff)) then
         begin
            PlotColor=ShortColor ;
            AlertMessage="Short";
         end

      Else
If ((MAValue <= OldMAValue) and (MACDDiff >= OldMACDDiff)) or ((MAValue >= OldMAValue) and (MACDDiff <= OldMACDDiff)) then
         begin
            PlotColor=NoActionColor;
            AlertMessage="NoAction";
         end;


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

Reply With Quote
 
  #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 io > > > > > Another EL Learning Exercise

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

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


All times are GMT -4. The time now is 12:33 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-16 in 0.07 seconds with 19 queries on phoenix via your IP 54.226.113.250