logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
StorkBite  
#1 Posted : Tuesday, May 31, 2005 3:17:22 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Anyone using the price oscillator regularly? I'm interested in how to find optimal settings for intraday trading at different time intervals. Right now I'm using a 15 minute interval. Any help is appreciated.
wabbit  
#2 Posted : Sunday, July 24, 2005 5:39:45 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Absolute Price Oscillator, is just another term for MACD... See, for examle: http://www.stockcharts.c...dic_priceOscillator.html and http://www.traderslog.co...ute-Price-Oscillator.htm Now, for time periods. One way is to observe the changes made when different time period values are used. The larger the change, the more sensitive the stock to this indicator. Depending on your style (trading, gambling or investing) you should choose periods that suit. Another way is to go "data mining" or "curve fitting". Create a system test based on your indicator and use the optimisation functions to find the most profitable combination of numbers, the best win/loss ratio etc.... I do not like this approach, I like to adjust the logic of the system, not just the numbers. The testing can take a long, LOOONG time if you test across the entire universe of stocks and have many opt's in the test. I used to leave mine running overnight and come back the nexy day - until I learned to take a small sample of stocks first and test with them with wide open opt limits. Then I would narrow the opt limits and widen the stock universe, then eventually I would be trying to fit a finite (small) opt range to the entire stock market. As I said, I now play with system logic, but hope this helps with your situation. wabbit :D
StorkBite  
#3 Posted : Monday, July 25, 2005 8:11:01 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Thanks Wabbit! This is great stuff. I'll study it closely. :D
StorkBite  
#4 Posted : Tuesday, July 26, 2005 11:05:31 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
You know, Wabbit, the value of your comments often lie in their thought provocation... at least for me. I read all of your stuff (but only understand about 5% :oops: ). Still, you always seem to enlighten me. Many times I sense you going the extra mile for everyone here when a simpler answer might suffice. That's where your true nature is found. I just wanted to say THANK YOU for all that you do. Without mentors like you, things just wouldn't be the same!
StorkBite  
#5 Posted : Tuesday, July 26, 2005 11:11:28 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
I studied the stuff you showed me. It's cool. I made a signal indicator based on the Percentage Price Oscillator. This is what I came up with. Tell me what you think. You know I still need validation! :P {Short term EMA} STEMA:= Mov(C,5,E); {Long term EMA} LTEMA:= Mov(C,20,E); {Percentage Price Oscillator} PPO:= (STEMA-LTEMA)/LTEMA; {Crossover Signal} XOS:=Mov(PPO,9,E); If(PPO>XOS,1,-1);0; UserPostedImage
wabbit  
#6 Posted : Wednesday, July 27, 2005 12:49:29 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Thanks for your kind words and thoughts. I like the look of your code and the indicator. Have you tried experimenting with any of the other moving average types, for example: {Zero Lag Moving Average} {cannot remember who to credit with this one?} prd:= Input("MA Periods",1,250,10); x:=Input("1-O, 2-H, 3-L, 4-C",1,4,4); x:=If(x=1,O,If(x=2,H,If(x=3,L,C))); EMA1:=Mov(x,prd,E); EMA2:=Mov(EMA1,prd,E); Difference:= EMA1 - EMA2; ZeroLagEMA:= EMA1 + Difference; ZeroLagEMA {Kaufman Adaptive Moving Average} Periods := Input("Time Periods",1,1000, 10); Direction := CLOSE - Ref(Close,-periods); Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods); ER := Abs(Direction/Volatility); FastSC := 2/(2 + 1); SlowSC := 2/(30 + 1); SSC := ER * (FastSC - SlowSC) + SlowSC; Constant := Pwr(SSC,2); AMA := If(Cum(1) = periods +1, ref(Close,-1) + constant * (CLOSE - ref(Close,-1)),Prev + constant * (CLOSE - PREV)); AMA {Mod. Kaufman's Adaptive Moving Average} {modified by wabbit} prd:=Input("Time Periods",1,1000,31); K:=Power(ROC(CLOSE,prd,$)/Sum(Abs(ROC(CLOSE,1,$)),prd),2); If(Cum(1)<=prd+1,C,PREV*(1-K)+C*K); {PS Adaptive Moving Average} If(Cum(1)=5, Ref(C,-1)+(Pwr((Abs((C-Ref(C,-4))/Sum(Abs(ROC(C,1,$)),4)))*((2/3)-(2/31))+(2/31),2))*(C-Ref(C,-1)), PREV+(Pwr((Abs((C-Ref(C,-4))/Sum(Abs(ROC(C,1,$)),4)))*((2/3)-(2/31))+(2/31),2))*(C-PREV)) You might also find you can increase the code's flexibility and edit-ability (if there is such a word?) if you use the Input() function for your variables. when you set the default value, this is the value that any othe indicator calling this formula will "see" so it is just the same as hard-coding, for example the MA periods; e.g. fastPrd:=Input("Fast MA Periods",1,100,5); slowPrd:=Input("Slow MA Periods",1,100,20); {Error checking} {see Note} prd1:=LastValue(Min(fastPrd,slowPrd)); prd2:=LastValue(Max(fastPrd,slowPrd)); {Short term EMA} STEMA:= Mov(C,prd1,E); {Long term EMA} LTEMA:= Mov(C,prd2,E); {Percentage Price Oscillator} PPO:= (STEMA-LTEMA)/LTEMA; {Crossover Signal} XOS:=Mov(PPO,9,E); If(PPO>XOS,1,-1);0; Note: Someone once wrote, "Remove errors induced between the chair and the computer!" I laughed. Hope this helps. wabbit :D P.S. G: If ever you don't understand anything, please ask for an explanation. "There is no such thing as a dumb question." I am only too happy to help.
ferrdav  
#7 Posted : Saturday, August 27, 2005 11:26:37 PM(UTC)
ferrdav

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 8
Location: ITALY

Hallo wabbit, i was looking for ama code and found yours, but i'm struggling trying them work... i insert this formula: prd:=Input("Time Periods",1,1000,31); K:=Power(ROC(CLOSE,prd,$)/Sum(Abs(ROC(CLOSE,1,$)),prd),2); If(Cum(1)<=prd+1,C,PREV*(1-K)+C*K); called AMA. I have this code: if(mov(h,3,s)>mov(h,30,s),LE>SE,0) i'd like to let mov(h,3,s) be adaptive.. What should i write from Fml( "AMAK MOD") to get ad adaptive MA, simple, of H?... Thank you
wabbit  
#8 Posted : Sunday, August 28, 2005 9:13:54 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Try this: ---8<-------------------------------- {user inputs} p1:=Input("Time Periods 1",1,1000,3); p2:=Input("Time Periods 2",1,1000,30); x:=Input("Data: 1-O 2-H 3-L 4-C 5-MP 6-Typ",1,6,4); {error check} prd1:=LastValue(Min(p1,p2)); prd2:=LastValue(Max(p1,p2)); x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=4,C,If(x=5,MP(),Typical()))))); {computation} K1:=Power(ROC(x,prd1,$)/Sum(Abs(ROC(x,1,$)),prd1),2); MA1:=If(Cum(1)<=prd1+1,C,PREV*(1-K1)+C*K1); K2:=Power(ROC(x,prd2,$)/Sum(Abs(ROC(x,1,$)),prd2),2); MA2:=If(Cum(1)<=prd2+1,C,PREV*(1-K2)+C*K2); If(MA1>MA2,LE>SE,0) {etc....} ---8<-------------------------------- Hope this helps... wabbit :D
Users browsing this topic
Guest (Hidden)
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.