Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/13/2005(UTC) Posts: 87 Location: perth australia
|
Hi,
I have done some coding of my own to try to get the right set up for the countdown. My code below is rough but works. It includes Td intersection which states:
if intersection occurs on bar 8 or 9 of a buy setup, then countdown commences on the 9th bar of the buy set up providing the countdown criteria c <=ref(l,-2) is met. However if intersection occurs AFTER completion of a buy set up countdown begins on the bar after the buy set up that intersection occurs AND the countdown criteria c <=ref(l,-2) is met of course.
so my code goes:(this is only for buy countdown)
a%
X:=Sum(C < Ref(C,-4),9)=9 AND
Ref(C,-9) >= Ref(C,-13) AND
Sum(V > 0,10)=10;
y:=H >= Ref(LLV(L,6),-3) AND H <= Ref(HHV(H,6),-3);{TD Intersection)
z:=(Y AND x) OR (y AND Ref(x,-1) AND Ref(y,-1)<>1) OR (y AND Ref(x,-2) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1) OR (y AND Ref(x,-3) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1 AND Ref(y,-3)<>1) OR (y AND Ref(x,-4) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1 AND Ref(y,-3)<>1 AND Ref(y,-4)<>1) OR (y AND Ref(x,-5) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1 AND Ref(y,-3)<>1 AND Ref(y,-4)<>1 AND Ref(y,-5)<>1) OR (y AND Ref(x,-6) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1 AND Ref(y,-3)<>1 AND Ref(y,-4)<>1 AND Ref(y,-5)<>1 AND Ref(y,-6)<>1 ) OR (y AND Ref(x,-7) AND Ref(y,-1)<>1 AND Ref(y,-2)<>1 AND Ref(y,-3)<>1 AND Ref(y,-4)<>1 AND Ref(y,-5)<>1 AND Ref(y,-6)<>1 AND Ref(y,-7)<>1);
XX:=Z OR X AND Ref(Y,-1) AND Y=0;
signal:=xX AND Alert(x=0,2);
If(Ref(BarsSince(signal=1),-1)>5,signal,0)
***************************************
TD Buy 9
Fml("%a")=1 AND Ref(Fml("%a"),-1)=0
****************************************
TD - SetUp-Buy 1
Sum(C < Ref(C,-4),9)=9 AND
Ref(C,-9) >= Ref(C,-13) AND
Sum(V > 0,10)=10
*******************************************
TD SEQUENTIAL BUY2 C<L
C <= Ref(L,-2) AND V > 0
******************************************
TD Count Down Buy A(Seq)
Cum(If(Fml("TD SEQUENTIAL BUY2 C<L"),1,0)) - ValueWhen(1,Ref(Fml("TD BUY 9" ), 1)=1,
Cum(If(Fml("TD SEQUENTIAL BUY2 C<L"),1,0)))
****************************************
Setup buy
Ref( Fml( "TD - SetUp-Buy 1" ) ,8)=1
*************************************
Setup buy 2
Ref( Fml( "TD - SetUp-Buy 1" ) ,7)=1
*************************************
*3
*4
*5
*6
*7
*8
*************************************
Setup buy 9
Fml( "TD - SetUp-Buy 1" )=1
*************************************
Countdown buy 1
Fml( "TD Count Down Buy A(Seq)" ) =1 AND Ref( Fml( "TD Count Down Buy A(Seq)" ) ,-1)<>1
***************************************
*2
*3
*4
*5
*6
*7
*8
*9
*10
*11
*12
****************************************
Countdown buy 13
Fml( "TD Count Down Buy A(Seq)" ) =13 AND Ref( Fml( "TD Count Down Buy A(Seq)" ) ,-1)<>13
**************************************
And when we reach countdown 13 we have to make sure the close of this bar is less than the close of bar 8 of the countdown. I don,t know how to code this.
If the close of bar 13 is not less than the close of bar 8 then we must wait for the first bar after bar 13 that is less than the close of bar 8.I do not know how to code this as well.
Also my Setup Buy's uses forward references. The only way around this is with a dll.
To date I have not been able to code TD COMBO. It needs a dll
Hope this enlightens people and hopefully we can improve on these codes.
Cheers
Norman
|