Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 04-14-2009, 01:20 PM   #9

Join Date: Jan 2007
Location: Toronto
Posts: 51
Ignore this user

Thanks: 2
Thanked 3 Times in 3 Posts

Re: Center of Gravity Bands

[QUOTE=Tams;62723]P.S.

the CG logic is simple enough, and MT4 is not that difficult, if you read through the MT4 manual, I am sure you can get the indicator coded.

Tams,

Thanks for your input.
email is offline  
Reply With Quote
Old 04-14-2009, 05:22 PM   #10

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,774
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Center of Gravity Bands

Quote:
Originally Posted by moneymarkets »
Thanks Tams, I had the oscillator, but would love to have the bands that go with it.
I have attached two pictures of it.
Thanks again.
I don't think John Elhers' Center of Gravity Oscillator is related to your Center of Gravity Bands.
Tams is offline  
Reply With Quote
Old 04-15-2009, 12:08 AM   #11

Join Date: Apr 2007
Location: Andalusia
Posts: 23
Ignore this user

Thanks: 3
Thanked 1 Time in 1 Post

Re: Center of Gravity Bands

Center of Gravity Bands are quite different from the Oscillator. I know easylanguage , but not exactly how to convert from Metatrader language.
It would be appreciated if someone could do it.
moneymarkets is offline  
Reply With Quote
Old 04-15-2009, 10:36 AM   #12
zdo

Join Date: Nov 2007
Location: boonies
Posts: 1,349
Ignore this user

Thanks: 317
Thanked 355 Times in 256 Posts
Blog Entries: 104

Re: Center of Gravity Bands

You guys would get a lot more help if you posted the code you need translated...
zdo is offline  
Reply With Quote
Old 04-15-2009, 10:43 AM   #13

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,774
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Center of Gravity Bands

Quote:
Originally Posted by zdo »
You guys would get a lot more help if you posted the code you need translated...
I agree...

some people would post a link and expect others to look for "it".

as a practice, I skip over the lazy requests.

;-)
Tams is offline  
Reply With Quote
Old 04-15-2009, 07:13 PM   #14

Join Date: Nov 2008
Location: San Jose
Posts: 8
Ignore this user

Thanks: 6
Thanked 10 Times in 3 Posts

Re: Center of Gravity Bands

Here is the code, picture and the source.



hxxp://www.forexfactory.com/showthread.php?t=99703
Attached Files
File Type: txt COG.txt (4.6 KB, 153 views)
phim9hi3n is offline  
Reply With Quote
The Following User Says Thank You to phim9hi3n For This Useful Post:
HBBHVN (04-16-2009)
Old 04-19-2009, 12:16 PM   #15

Join Date: Mar 2008
Location: Cesena
Posts: 3
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Center of Gravity Bands

Hi all.

I'm also searching for an easylanguage implementation of the center of gravity bands, also known as Hurst bands.
I have the following code which works well in proprealtime.
I tried to translate it in tradestation, it looks easy, but the results are wrong.
My problem is the DPO function used in the prorealtime code.
I substituted it using the detrend function in tradestation but it's not the same.
So I'm not able to go on.
Anyone can help?


REM VIDEO
REM The gravity center from Mustafa Belkhayate
k=p3 // Variable p3= 65

de48=DPO[k*2](close)
if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] then
flag=1
endif
n=(k*2)-4
p=(n/2)-1
d100=DPO[n](close)
moy100=close-d100
co=(moy100-moy100[1]+(close[p])/n)*n
if flag[1]=1 and flag[2]=0 then
hh=co[1]
endif
if flag[1]=1 then
co=hh
endif
n=p3 mod 2
p=(p3-n)/2
p3=(2*p)+1
once x=0
w=abs((p-x)/p)
w=w*w*w
w=(1-w)
w=w*w*w
x=x+1
if barindex=p3 then
a=0
b=0
e=0
for i=1 to p3
z=barindex-i+1
a=a+w[z]
b=b+w[z]*(i)
e=e+(i)*(i)*w[z]
next
endif
if barindex>p3 then
c=0
d=0
for i=1 to p3
z=barindex-i+1
c=c+co[p3+p-i]*w[z]
d=d+co[p3+p-i]*w[z]*(i)
next
endif
alpha=(a*d-b*c)/(a*e-b*b)
beta=(c*e-b*d)/(a*e-b*b)
lowess=alpha*(p+1)+beta
if barindex < p3*2 then
lowess=undefined
endif

zz = close - lowess
zzsigma = STD[p3](zz)
bb1 = lowess + zzsigma
bb2 = lowess +1.618* zzsigma
bb3 = lowess +2* zzsigma
bl1 = lowess - zzsigma
bl2 = lowess - 1.618* zzsigma
bl3 = lowess - 2* zzsigma

return lowess, bb1, bb2, bb3, bl1, bl2, bl3
mtorri is offline  
Reply With Quote
Old 04-20-2009, 07:24 PM   #16

Join Date: Apr 2007
Location: Andalusia
Posts: 23
Ignore this user

Thanks: 3
Thanked 1 Time in 1 Post

Re: Center of Gravity Bands

Thanks for your input, would you mind posting what you have for easylanguage so far, to see if we can help?
thanks
moneymarkets is offline  
Reply With Quote

Reply

Tags
center of gravity, john ehlers

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigma Bands for CQG Soultrader Trading Indicators 12 01-05-2010 06:27 PM
Question regarding Bollinger Bands Robert Technical Analysis 22 08-08-2009 10:37 PM
CQG VWAP SD Bands Creation??? Garylim Market Profile 11 03-22-2009 04:32 PM
Volatility Bands scalper4 Coding Forum 9 03-08-2009 06:39 PM
Problem with Better Bollinger Bands HBBHVN Coding Forum 1 02-24-2009 06:12 AM

All times are GMT -4. The time now is 06:02 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.