Forex



Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2007, 01:49 PM
Member
 
Join Date: Mar 2007
Posts: 58
EBTAFOLLOWER is on a distinguished road
SINE TREND system from Ehler

Hello:

I could not find a thread on this topic, so I decided to start a new one. I did not want to put it inthe digital filters one, as it (I think) deserves a topic on its own.

In his book "rocket science for traders" John Ehlers describes a systemn that may have some value.

I am not a MQL4 programmer, so I wanted to bring this up to the programming community here. perhaps this system described in Ehlers book can be coded in MQL4 and used effectively.

The system basically detects/senses the state (cycle) of the market in question, and if it detects the market is trending, it switches to trend mode trading, and if it detects the market is ranging, it switches to range mode.

Here is the code of the system in Ehlers' code's, can a programmer in this forum convert this to MQL4?

Thanks and regards to all.

EF

{***************************************

Written by: Ehlers - Rocket science for traders
typed by Henry Amand

Description: SineTrend system, page 120

****************************************}

Inputs: Price((H+L)/2);

Vars: Smooth (0),
Detrender (O) ,
I1 (0),
Q1 (O),
jI (O),
JQ (0),
I2 (0),
Q2 (0),
Re (0),
Im (0),
Period (0),
SmoothPeriod (O),
SmoothPrice (O),
DCPeriod (O),
RealPart (0),
Imagpart (O),
count (0),
DCPhase (O),
DCSine (O),
LeadSine (O),
Itrend (O),
Trendline (O),
Trend (0),
DaysinTrend (O);



If CurrentBar > 5 then begin


Smooth = (4*Price + 3*Price[1] + 2*Price[2] + Price[3]) / 10;
Detrender = (.0962 * Smooth + .5769 * Smooth[2] - .5769 *
Smooth[4] - .0962*Smooth[6]) * (.075 * Period[1] + .54);


{Compute InPhase and Quadrature components.}

Q1 = (.0962 * Detrender + .5769 * Detrender[2] - .5769
* Detrender[4] - .0962 * Detrender[6]) * (.075 * Period[1] + .54);
I1 = Detrender[3];


{Advance the phase of I1 and Q1 by 90 degrees}

jI = (.0962 * I1 + .5769 * I1[2] - .5769 * I1[4] -
.0962 * I1[6]) * (.075 * Period[1] + .54);
JQ = (.0962 * Q1 + .5769 * Q1[2] - .5769 * Q1[4] -
.0962 * Q1[6]) * (.075 * Period[1] + .54);


{Phasor addition for 3 bar averaging)}

I2 = I1 - JQ;
Q2 = Q1 + jI;


{Smooth the I and Q components before applying
the discriminator}

I2 = .2 * I2 + .8 * I2[1];
Q2 = .2 * Q2 + .8 * Q2[1];


{Homodyne Discriminator}

Re = I2 * I2[1] + Q2 * Q2[1];
Im = I2 * Q2[1] - Q2 * I2[1];
Re = .2 * Re + .8 * Re[1];
Im = .2 * Im + .8 * Im[1];

If Im <> 0 and Re <> 0 then Period = 360 / ArcTangent (Im/Re);
If Period > 1.5 * Period[1] then Period = 1.5 * Period[1];
If Period < .67 * Period[1] then Period = .67 * Period[1];
If Period < 6 then Period = 6;
If Period > 50 then Period = 50;
Period = .2 * Period + .8 * Period[1];
SmoothPeriod = .33 * Period + .67 * SmoothPeriod[1];


{Compute Dominant Cycle Phase}

SmoothPrice = (4 * price + 3 * Price[1] + 2 * Price[2] +
Price[3]) / 10;
DCPeriod = IntPortion(SmoothPeriod + .5);
RealPart = 0;
ImagPart = 0;


For count = 0 To DCPeriod - 1 begin

RealPart = RealPart + sine (360 * count / DCPeriod) *
(SmoothPrice[count]);
ImagPart = imagPart + CoSine (360 * count / DCPeriod) *
(SmoothPrice[count]);

End;

If AbsValue(ImagPart) > 0 then DCPhase =
Arctangent(RealPart / ImagPart);
If AbsValue(ImagPart) <= .001 then DCPhase =
DCPhase + 90 * Sign(RealPart);
DCPhase = DCPhase + 90;


{Compensate for one bar lag of the Weighted Moving Average}

DCPhase = DCPhase + 360 / SmoothPeriod;

If ImagPart < 0 then DCPhase = DCPhase + 180;
If DCPhase > 315 then DCPhase = DCPhase - 360;


{Compute the Sine and LeadSine Indicators}

DCSine = Sine(DCPhase);
LeadSine = Sine(DCPhase + 45);


{Compute Trendline as simple average over the measured
dominant cycle period}

ITrend = 0;

For count = 0 to DCPeriod - 1 begin
ITrend = ITrend + Price[count];
End;

If DCPeriod > 0 then ITrend = ITrend / DCPeriod;
Trendline = (4 * ITrend + 3 * ITrend[1] + 2 * ITrend[2]
+ ITrend[3]) / 10;
If CurrentBar < 12 then Trendline = Price;


{Assume Trend Mode}

Trend = 1;


{Measure days in trend from last crossing of the
Sinewave Indicator lines}

If Sine(DCPhase) Crosses Over Sine(DCPhase + 45) or
Sine(DCPhase) Crosses Under Sine(DCPHase + 45) Then begin
DaysInTrend = 0;
Trend = 0;
End;

DaysInTrend = DaysInTrend + 1;
If DaysInTrend < .5 * SmoothPeriod then Trend = 0;


{Cycle Mode If delta phase is +/- 50% of dominant cycle
change of phase}

If SmoothPeriod <> 0 and (DCPhase - DCPhase[1] > .67 * 360 /
SmoothPeriod and DCPhase - DCPhase[1] < 1.5 * 360 /
SmoothPeriod) then Trend = 0;


{Declare a Trend Mode if the SmoothPrice is more than 1.5%
from the Trendline}

If AbsValue ((SmoothPrice - Trendline) / Trendline) >=
.015 then Trend = 1;

If Trend = 1 then begin

If Trend [1] = 0 then begin

If MarketPosition = -1 and SmoothPrice >= Trendline then buy;
If MarketPosition = 1 and SmoothPrice < Trendline then sell;

End;

If SmoothPrice Crosses Over Trendline then buy;
If SmoothPrice Crosses Under Trendline then sell;
End;

If Trend = 0 then begin

If LeadSine Crosses Over DCSine then buy;
If LeadSine Crosses Under DCSine then sell;

End;
End;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 05-29-2007, 02:32 PM
Member
 
Join Date: Jan 2006
Posts: 64
kidhudi is on a distinguished road
what program is this written for?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 05-29-2007, 02:49 PM
Member
 
Join Date: Mar 2007
Posts: 58
EBTAFOLLOWER is on a distinguished road
easylanguage code

I believe it is called easylanguage code, but can't recall right now the name of the platform that it is for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 05-29-2007, 04:18 PM
Malcik's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Pilsen, Czech Republic
Posts: 150
Malcik is on a distinguished road
It is written for TradeStation. I too tried to rewrite it to MQL4 some time ago but never got it to work. This is why I don't read Ehlers very much anymore because I'm not even able to test his ideas. I'd be glad if we could figure it out because it's sure worth it.

Maybe even smarter and more useful thing to do would be to rewrite his indicator for measuring market -- it's called Cycle Period and is described in Cybernetics Analysis for Stocks and Futures.
__________________
Malcik
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 05-29-2007, 05:05 PM
Member
 
Join Date: May 2007
Posts: 39
billbss is on a distinguished road
Ehler likes complexity.

If you want to see how his methods really work, go to Futures Truth and check the performance of his Mesa systems. They monitor futures systems and report the results.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 05-30-2007, 01:48 AM
SIMBA's Avatar
Senior Member
 
Join Date: May 2006
Posts: 1,398
SIMBA is on a distinguished road
Complexity..116.9%

Quote:
Originally Posted by billbss
Ehler likes complexity.

If you want to see how his methods really work, go to Futures Truth and check the performance of his Mesa systems. They monitor futures systems and report the results.
Hi..I too like THIS kind of complexity..

Top 10 S&P Systems

Rank System Name Annual % Return
1. Keystone 126.2%
2. R-mesa 3 116.9%

3. R-Breaker 72.3%
4. %C Daybreaker 69.3%
5. STC S&P Daytrade 68.0%
6. RC Success 56.9%
7. RC Edge 54.9%
8. Cyclone 54.6%
9. Tzar 49.1%
10. Mechwarrior 47.

R-Mesa 3 John Ehlers/Mike Barna

Top 10 Systems Since Their Release Date

Rank System Name Annual % Return
1. Anticipation 254.0%
2. Samurai 35 221.8%
3. Qtech Bellies 191.5%
4. ATS-3200 174.7%
5. Natural Gas Offense 164.5%
6. Natural Gas Trader - MA 151.9%
7. Natural Gas Trader - GA 128.0%
8. Natural Gas Trader - LA 124.5%
9. Anticipation II 118.6%
10. R-Mesa 3 116.9%




Regards
__________________
Equo ne credite,Teucri.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 05-30-2007, 05:20 AM
Member
 
Join Date: May 2007
Posts: 39
billbss is on a distinguished road
Then buy his books and implement his methods.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 05-30-2007, 06:16 AM
Gramski's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 267
Gramski is on a distinguished road
This is the closest indicator I've seen to at least resembling Sinewave.
TDI...obviously not the same but the concept is similar.

Personally over time I've found I don't care much for this stuff....
Attached Files
File Type: mq4 TDI-2.mq4 (3.5 KB, 294 views)

Last edited by Gramski; 05-30-2007 at 06:30 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 05-30-2007, 09:36 AM
SIMBA's Avatar
Senior Member
 
Join Date: May 2006
Posts: 1,398
SIMBA is on a distinguished road
Books And Methods

Quote:
Originally Posted by billbss
Then buy his books and implement his methods.
I already did,both,and I shared some of my views on them,extensively, in this Forum..By the way,that is what we were supposedly trying to do in this thread,implement one of his methods in mt4.....did you notice ?

So ..what was the meaning of your posts ?


Where a child will see three letters, the student will see one word.... the master will understand its meaning....
__________________
Equo ne credite,Teucri.

Last edited by SIMBA; 05-30-2007 at 12:15 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 05-30-2007, 12:52 PM
Member
 
Join Date: May 2007
Posts: 39
billbss is on a distinguished road
Quote:
Originally Posted by SIMBA
I already did,both,and I shared some of my views on them,extensively, in this Forum..By the way,that is what we were supposedly trying to do in this thread,implement one of his methods in mt4.....did you notice ?

So ..what was the meaning of your posts ?


Where a child will see three letters, the student will see one word.... the master will understand its meaning....

What is the meaning of my posts?

Here is the meaning of my first post.

Quote:
Ehler likes complexity.

If you want to see how his methods really work, go to Futures Truth and check the performance of his Mesa systems. They monitor futures systems and report the results.
1.
Quote:
Ehler likes complexity.
Complexity= The quality or condition of being complex.

Complex= Involved or intricate- complicated.


2.
Quote:
If you want to see how his methods really work, go to Futures Truth and check the performance of his Mesa systems. They monitor futures systems and report the results.
This means that Ehler's mesa system is monitored and reported on at a web site called Futures Truth.

I meant you can go there and see its results.

It appears you did that. What did you not understand about this post?


My other post:

Quote:
Then buy his books and implement his methods.

You replied that you had already done this. What did you not understand about it?

Quote:
By the way,that is what we were supposedly trying to do in this thread,implement one of his methods in mt4..;
Its likely that I noticed since my post was about Ehler. Don't you think?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
mesa sine wave indicator, Trendline, itrend, trend line, SineTrend, Trend, Trend System, r-mesa 3, sine wave, ehlers sine wave, mesa ehler, mesa ehlers, ehler


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Daily ASC Trend system returned +766 pips in Jan kiwifxguy Suggestions for Trading Systems 13 11-13-2009 09:43 AM
The TrendStuffer System - easy trend prediction for everyone! SirKhan Commercial Trading Systems and indicators 817 11-02-2009 04:25 PM
Trend Catcher/ Profitable System JaneFX General Discussion 43 05-10-2008 09:50 PM
Moving average trend-following system newdigital Manual trading systems 1 01-04-2006 04:24 PM


All times are GMT. The time now is 12:21 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.