Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Ehlers Early Trend Detection - The Quotient Transform Indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
SweetAndSour
Posted : Monday, November 27, 2017 3:58:32 AM
Registered User
Joined: 5/26/2017
Posts: 25

I wonder wheter it is possible to built a pretty complicated Ehlers indicator in TC2000? Last week i posted a newly developed Ehlers early trend detection indicator on futures.io,  which was presented in the August 2014 issue of the TASC magazine.

Look at the picture so you can see the indicator in action: https://futures.io/local_links.php?action=ratelink&catid=27&linkid=1936

Here's the complete formula developed in Microsoft C-Sharp fpr Ninjatrader. Note that Input[0] is the current bar while Input[1] is one bar a go and so on...

private double alpha1;
private double a1;
private double b1;
private double c1;
private double c2;
private double c3;
private double x;
private double quotientFastLong;
private double quotientSlowLong;
private double quotientFastShort;
private double quotientSlowShort;
private double kFastLong = 0.40;
private double kSlowLong = 0.90;
private double kFastShort = -0.40;
private double kSlowShort = -0.90;
private Series<double> HP;
private Series<double> Filt;
private Series<double> Peak;
 
AddPlot(new Stroke(Brushes.LightGreen, 1), PlotStyle.Line, "QTFastLong");
AddPlot(new Stroke(Brushes.Green, 1), PlotStyle.Line, "QTSlowLong");
AddPlot(new Stroke(Brushes.IndianRed, 1), PlotStyle.Line, "QTFastShort");
AddPlot(new Stroke(Brushes.Red, 1), PlotStyle.Line, "QTSlowShort");
AddLine(Brushes.Yellow, 0.0, "Zero");
 
LPPeriod = 20;
 
alpha1 = ((Math.Cos(((.707 * 360 / 100) * Math.PI) / 180)) + (Math.Sin(((.707 * 360 / 100) * Math.PI) / 180)) - 1) / (Math.Cos(((.707 * 360 / 100) * Math.PI) / 180));
a1 = Math.Exp(-1.414 * 3.14159 / LPPeriod);
b1 = 2 * a1 * (Math.Cos(((1.414 * 180 / LPPeriod) * Math.PI) / 180));
c2 = b1;
c3 = (a1 * -1) * a1;
c1 = 1 - c2 - c3;
 
HP[0] = ((1 - alpha1 / 2) * (1 - alpha1 / 2) * (Input[0] - 2 * Input[1] + Input[2]) + 2 * (1 - alpha1) * HP[1] - (1 - alpha1) * (1 - alpha1) * HP[2]);
Filt[0] = (c1 * (HP[0] + HP[1]) / 2 + c2 * Filt[1] + c3 * Filt[2]);
Peak[0] = (Peak[1] * 0.991);
 
if (Math.Abs(Filt[0]) > Peak[0])
    Peak[0] = (Math.Abs(Filt[0]));
 
if (Peak[0] < 0.0 || Peak[0] > 0.0)
    x = (Filt[0] / Peak[0]);
 
quotientFastLong = (x + KFastLong) / (KFastLong * x + 1);
quotientSlowLong = (x + KSlowLong) / (KSlowLong * x + 1);
quotientFastShort = (x + KFastShort) / (KFastShort * x + 1);
quotientSlowShort = (x + KSlowShort) / (KSlowShort * x + 1);
 
QTFastLong[0] = (quotientFastLong);
QTSlowLong[0] = (quotientSlowLong);
QTFastShort[0] = (quotientFastShort);
QTSlowShort[0] = (quotientSlowShort);
Bruce_L
Posted : Monday, November 27, 2017 12:52:28 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I cannot think of a practical method of creating this using Custom PCF Indicators in TC2000.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SweetAndSour
Posted : Tuesday, November 28, 2017 10:36:10 AM
Registered User
Joined: 5/26/2017
Posts: 25

QUOTE (Bruce_L)

I cannot think of a practical method of creating this using Custom PCF Indicators in TC2000.

 

Ok thanks anyway ;-)

Bruce_L
Posted : Tuesday, November 28, 2017 10:42:17 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.