Discussions
»
Product and Service Development
»
Formula Assistance
»
Price Hadley's Acceleration Bands formula [RESOLVED]
Rank: Member
Groups: Registered, Registered Users Joined: 10/12/2005(UTC) Posts: 10
|
Could someone please translate this TradeStation EasyLanguage formula to Metastock language.
UpperBand = Average((high x (1+2x (((high - low)/((high + low) /2)) x 1000) x .001))) , 20
MidPoint = Average (close, 20)
LowerBand = Average ((low x (1-2 x (((high - low) / ((high + low) / 2)) x 1000) x .001))) , 20
Thank you
Denis
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Denis-
Try this:
[code:1:64756eb3e8]ub:= Mov(H*(1+2*(((H-L)/((H+L)/2))*1000)*0.001),20,E);
mb:=Mov(C,20,E);
lb:= Mov(L*(1-2*(((H-L)/((H+L)/2))*1000)*0.001),20,E);
ub;mp;lb[/code:1:64756eb3e8]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 10/12/2005(UTC) Posts: 10
|
Thanks Stockman for you help.
There seems to be a problem with the last line ub;mp;lb I get an error message saying A "I" (I think) must immediately follow a function name?
What does that mean please?
Regards
Denis
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
The "*1000*0.001" part and some formula brackets are redundant code, and TS's "Average" function is probably a SMA.
jose '-)
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 10/12/2005(UTC) Posts: 10
|
Hi Jose,
I am sorry but I do not understand your answer. I still have a lot to learn. How can I get this formula to work?
Thanks
Denis
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Well... I was trying to stick with the original style as posted and failed... keep me straight, J!!! LOL!
Try this then:
[code:1:b0bf4d9e12]UB:= Mov(H*(1+2*(((H-L)/((H+L)/2))*1000)*0.001),20,S);
MB:= Mov(C,20,S);
LB:= Mov(L*(1-2*(((H-L)/((H+L)/2))*1000)*0.001),20,S);
UB;MB;LB;[/code:1:b0bf4d9e12]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 10/12/2005(UTC) Posts: 10
|
Thanks stocmman, It seems to work ok, but I had to change mid to middle before it would for some reason... thank again
Denis
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Sorry, I was using a reserved word. You can make the labels read whatever is good for you.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Reposted for Weird...
Weird wrote:This is my take on Price Headley's Momentum Divergence from Big Trends in Trading, adapted from TS code,
{Headley Momentum Divergence}
pds:=Input("Periods",15,40,15);
Value1:=If(HHV(MACD(),pds)-LLV(MACD(),pds)<>0,HHV(MACD(),pds)-LLV(MACD(),pds),50);
Value2:=If(HHV(CLOSE,pds)-LLV(CLOSE,pds)<>0,HHV(CLOSE,pds)-LLV(CLOSE,pds),50);
PcClose:=100*(CLOSE-LLV(CLOSE,15))/value2;
PcMACD:=100*(MACD()-LLV(MACD(),15))/value1;
PcClose;PcMACD;
30;90;
Signal given when PcClose and PcMACD both above 90, and additionally using price above a MA envelope.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Price Hadley's Acceleration Bands formula [RESOLVED]
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.