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

Notification

Icon
Error

2 Pages<12
Options
Go to last post Go to first unread
Spaceant  
#21 Posted : Thursday, August 18, 2005 1:17:44 AM(UTC)
Spaceant

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/16/2005(UTC)
Posts: 182

Quote:
I looked at the code a few times. it's confusing but I will get there ... Hi Patrick, How's the coding on the ACD system based on the the previous posting of the expert advisor developed in Metatrade 4? Besides, I am trying to code the ATDFM and has developed some work.. and need improvement. Will seek your advice at a later stage. Also, I notice that someone has asked if MS could square the trade in two lots (say by 1/2 and 1/2) if two subsequent conditions staisfy after a trade has been triggered earlier. Unfortunately, I can't find the message again. I need this to code ATDMF as well. Is it possible? Gary
wabbit  
#22 Posted : Thursday, August 18, 2005 12:59:39 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)
Gary, This is what I have so far.... --8<------------------------- {Bollinger Bands} UB:=BBandTop(Typical(),20,S,2); LB:=BBandBot(Typical(),20,S,2); {Keltner} UKband:=Mov(Typical(),20,S)+1.5*Mov((H-L),20,S); LKband:=Mov(Typical(),20,S)-1.5*Mov((H-L),20,S); {Moving Averages} M7:=Mov(C,7,S); M23:=Mov(C,23,S); {dummy variable to make code work} {haven't figured what to do with the time period thing yet} {MH7:=Mov(C,(7*Per),S);} MH7:=Mov(C,7,S); {Slow Stochastic} StDK:=Mov(Stoch(14,3),3,S); StDD:=Mov(StDK,3,S); {MACD} FL:=Mov(C,9,E)-Mov(C,19,E); SL:=Mov(Mov(C,9,E)-Mov(C,19,E),6,E); {Trades} Cond1:=C>UB OR C<LB AND Mov(UKband-LKband,6,S)>Mov(UB-LB,6,S); Short:=Cond1 AND SAR(0.02,0.2)>C AND ROC(M7,1,%)<0 AND STDK<STDD AND FL<SL AND (O-C)>((H-O)+(C-L)) AND C<LB; Long:=Cond1 AND SAR(0.02,0.2)<C AND M7>M23 AND ROC(M7,1,%)>0 AND ROC(MH7,1,%)>0 AND STDK>STDD AND FL>SL AND (C-O)>((O-L)+(H-C)) AND C>UB; {plot} Long-Short; --8<------------------------- Is this looking right? wabbit :D
garykong  
#23 Posted : Thursday, August 18, 2005 4:29:50 PM(UTC)
garykong

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 112

Hi Wabbit, Your code is very neat, it looks great and I will revert after trying it later... regarding the following:- [quote=MH7" means the higher timeframe (15-min). The condition here requiring the moving average of 7-period in 15-min timeframe, ie. trending upward for BUY & trending downward for SELL... remember that we are coding in 5-min timeframe chart... Besides, the stop loss is signaled when price to be lower than the lower Bollinger Band in 1-min timeframe, a lower timeframe, (again remember the trading timeframe is 5-min timeframe to do the coding). That's hard to code, right? One thing to seek your advice is to code the condition: Bollinger Moving Average to be flat for six periods. The sample coding uses: Mov(UKband-LKband,6,S)>Mov(UB-LB,6,S); Any comment and suggestion? Regards Gary p/s Patrick, any news on the coding on ACD Methodology? I know that you have been busy..... :roll
Patrick  
#24 Posted : Friday, August 19, 2005 3:33:26 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Sorry Gary, I have been a little too busy lately :( Though I will get there at some point ... just like everything else :D Patrick :mrgreen:
wabbit  
#25 Posted : Sunday, August 21, 2005 1:14:51 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)
garykong wrote:
This is one of the toughest thing to code. Let say the trading timeframe is 5-min, the "MH7" means the higher timeframe (15-min). The condition here requiring the moving average of 7-period in 15-min timeframe, ie. trending upward for BUY & trending downward for SELL... remember that we are coding in 5-min timeframe chart...
Gary, Have you thought about simplifying the criteria to meet the capabilities of MS? Instead of writing eoms of code to create sniffers to find out the current periodicity amd then increase one unit of periodicity for the sake of one line in an indicator; why not just use a longer multiple in the current periodicity. e.g. If the base time frame is five minutes, then a seven-period 15 minute MA is almost equal to a 7*3 = 21 period 5 minute MA. If your trading system is too sensitive to deal with these very small "indiscretions" then might I suggest the system is too sensitive to be dealing with everyday life on the bourse? wabbit :D --8<------------------------- prdMultiplier:=3; {Bollinger Bands} UB:=BBandTop(Typical(),20,S,2); LB:=BBandBot(Typical(),20,S,2); {Keltner} UKband:=Mov(Typical(),20,S)+1.5*Mov((H-L),20,S); LKband:=Mov(Typical(),20,S)-1.5*Mov((H-L),20,S); {Moving Averages} M7:=Mov(C,7,S); M23:=Mov(C,23,S); MH7:=Mov(C,7*prdMultiplier,S); {Slow Stochastic} StDK:=Mov(Stoch(14,3),3,S); StDD:=Mov(StDK,3,S); {MACD} FL:=Mov(C,9,E)-Mov(C,19,E); SL:=Mov(Mov(C,9,E)-Mov(C,19,E),6,E); {Trades} Cond1:=C>UB OR C<LB AND Mov(UKband-LKband,6,S)>Mov(UB-LB,6,S); Short:=Cond1 AND SAR(0.02,0.2)>C AND ROC(M7,1,%)<0 AND STDK<STDD AND FL<SL AND (O-C)>((H-O)+(C-L)) AND C<LB; Long:=Cond1 AND SAR(0.02,0.2)<C AND M7>M23 AND ROC(M7,1,%)>0 AND ROC(MH7,1,%)>0 AND STDK>STDD AND FL>SL AND (C-O)>((O-L)+(H-C)) AND C>UB; {plot} Long-Short;
garykong  
#26 Posted : Monday, September 5, 2005 4:15:42 AM(UTC)
garykong

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 112

Hi Patrick, Are you still working on the ACD indicators (Metatrade) that I have posted earlier?....Sorry to bother you again, but just want to know that it is still on your list (hope it is not too long, right?)..... Cheers! Gary
Users browsing this topic
Guest (Hidden)
2 Pages<12
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.