Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter - ThinkOrSwim Programming | futures io social day trading

Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter
 Updated: May 16th, 2012 (10:19 AM) Views / Replies: 2,369 / 1 Created: March 5th, 2012 (03:57 AM) by cameroon Attachments: 0

 Welcome to futures io.

# Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter

 March 5th, 2012, 03:57 AM #1 (permalink) Trading Apprentice New York, New York   Futures Experience: Intermediate Platform: Thinkorswim Favorite Futures: Stocks   Posts: 1 since Mar 2012 Thanks: 0 given, 0 received Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter Here's the EasyLanguage code for John Ehlers' 4 Pole Gaussian Filter: Four Poles: f = alpha^4g + 4(1-alpha)f[1] - 6(1-alpha)^2f[2] + 4(1-alpha)^3f[3] - (1-alpha)^4f[4] g=price and where alpha = =-Beta+SQR(Beta^2 +2*Beta), and Where Beta = (1  cos(symbol)) / (1.414^2/N  1), where symbol = 2pi/P, N = # of poles in the filter, in this case 4, and P = Period, i.e 15 Here's what I came up with: (I just solved what 2pi b/c I don't know the function to use for pi, and I solved what 1.414^(2/N); N=4(4 Pole), so equals 1.18911732 minus 1 from the EasyLanguage formula above. The problem I'm experiencing is that I get a legit plot for 15 period, but once I adjust the plot, i.e move to 20 period, it goes insane, rendering it useless for higher than 20 period. Reason? Any suggestion would be awesome. input period = 15; input paintbars = {"Yes", default "No"}; def price = vwap; def symbol = (6.28318531) / period; def beta = (1  Cos(symbol)) / (0.18911732); def alpha = -beta + Sqr(power(beta,2) + (2 * beta)); rec Gaussian = (Power(alpha, 4)) * price + (4 * (1 - alpha)) * Gaussian[1] - 6 * Power(1 - alpha, 2) * Gaussian[2] + 4 * Power(1 - alpha, 3) * Gaussian[3] - Power(1 - alpha, 4) * Gaussian[4]; plot GF= Gaussian;

 May 16th, 2012, 10:19 AM #2 (permalink) Trading Apprentice San Francisco   Futures Experience: Intermediate Platform: NinjaTrader, thinkorswim Favorite Futures: ES   Posts: 1 since Apr 2012 Thanks: 0 given, 1 received The thing to remember with EasyLanguage code is that it automatically converts degrees to radians whereas thinkscript does not. Here's a Gaussian 2-pole filter in thinkscript. Hope this helps. declare upper; input period = 9; script DegToRad {input degrees = 0.0; plot DegToRad = degrees * Double.Pi / 180;}; def beta1 = 2.415 * (1 - Cos(DegToRad(360.0 / period))); def alpha = -beta1 + Sqrt(beta1 * beta1 + 2 * beta1); def mCoef1 = alpha * alpha; def mCoef2 = 2 * (1 - alpha); def mCoef3 = -(1 - alpha) * (1 - alpha); rec mFilterSeries = mCoef1 * hl2 + mCoef2 * mFilterSeries[1] + mCoef3 * mFilterSeries[2]; plot GaussianFilter = if IsNaN(close[2*period]) then Double.NaN else mFilterSeries; GaussianFilter.SetDefaultColor(Color.yellow);
 The following 3 users say Thank You to divzero for this post:

 futures io > Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter

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

Elite only

Elite only

Jan 18

Jan 23

Elite only

Elite only

## Ran Aroussi: TBA

Elite only

 Similar Threads Thread Thread Starter Forum Replies Last Post ebtrader ThinkOrSwim Programming 4 December 15th, 2017 10:55 PM Silvester17 NinjaTrader 10 June 9th, 2014 05:45 PM zt379 Off-Topic 1 October 8th, 2011 01:39 AM jakfourie Matlab, R project and Python 2 September 7th, 2011 06:12 PM kbit Off-Topic 0 May 27th, 2011 11:59 AM

All times are GMT -4. The time now is 12:36 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.08 seconds with 19 queries on phoenix via your IP 54.226.113.250