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

Notification

Icon
Error

Options
Go to last post Go to first unread
alfonsine  
#1 Posted : Thursday, May 27, 2010 11:35:01 AM(UTC)
alfonsine

Rank: Member

Groups: Registered, Registered Users
Joined: 5/4/2010(UTC)
Posts: 18

I am new. I want to write an exploration to filter counters that has attain a high and undergoing a pull-back. The criteria is as follows: 1. H1=PB=High of Pivot Bar is the highest Price bar. H2=PB-1=High 1st price bar before PB H3=PB-2=High 2nd price bar before PB H4=PB+1=High1st price bar after PB {Condition 1 identify pullback after attaining high} Cond1: h1>h4 and h1>h2 and h1>h3 xH:=h1 xL:=Ref(L,PB) 2. Once we identify pullback, I want to be able to screen and differentiate them into 3 types. c=Consolidation. Inside Day. s=Small Correction. Subsequent days only 1 bar has a lower low than the PB bar low. b=Bigger Correction. Subsequent days has more than 1 lower low than the PB bar low. The Column A has entry price, Column B has a initial cut-loss price, Col C identify type of consolidation (c,s,b) If it is consolidation, c, Col A =Entry Price=High of PB, and Column B=the initial cut-loss price = Low of PB. and Col C=c a. If it is small correction, s, the Col A= Entry Price=High of PB, and Column B=Low of the Lowest of the price bar preceding after PB and Col C=s. b. If it is big correction, b, Column B=Low of the Lowest Price Bar (LPB) and Col C=b and Column A will be computed using the formulations as follows: c. In order to get the Entry Price, we need to identify the 2nd Lowest Price Bar(2PB) after PB. The Entry Price for S will be the high price (highest of 2PB and LPB). d. The exploration will only screen for counters up to 7 days corrections. After the 7 days, the momentum would have been lost and there is no point to continue screen after 7 days. Also the exploration will not screen counters if the current price break above the Entry Price. What I have tried but not successful. H1:=Ref(H,-2) L1:=L h2:=Ref(H,-1) L2:=Ref(L,1) h3:=H L3:=Ref(L,2) h4:=Ref(h,1) L4:=Ref(L,3) h5:=ref(h,2) L5:=Ref(L,4) h6:=ref(h,3) L6:=Ref(L,5) h7:=ref(h,4) L7:=Ref(L,6) h8:=ref(h,5) L8:=Ref(L,7) h9:=ref(h,6) h10:=ref(h,7) {Screening for Consolidation} Cond1:= h3>h2 and h2>h1 and h3>h4 cond2:= h>h4 an h>h5 and h>h6 and h>h7 and h>h8 and h>h9 and h>h10 and l
alfonsine  
#2 Posted : Monday, May 31, 2010 1:14:43 AM(UTC)
alfonsine

Rank: Member

Groups: Registered, Registered Users
Joined: 5/4/2010(UTC)
Posts: 18

My first attempt appear very unsuccessful. Here is my second attempt. I don't get any exploration probably because of the market conditions where it been down for a while. So I created a swing short. I can capture some swing shorts explorations, apparently not very successful to capture the consolidation and corrections stage. Hope someone can study and point out any of my mistakes. Swing Long Formulation. {Cond1. To Test for Pivot Bar which is the highest bar before pullback} {Cond1:=H < Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3);} PBH:=If(cond1,Ref(H,-1),0); PBL:=If(cond1,Ref(L,-1),0); Cond2:=Cond1 AND L>PBH;{Test for if recent bar fall within the PB} R:=PBH;{Resistance} SP:=PBL;{Support} Cond3:=Cond1 AND L < PBL;{Check for condition where the recent bar low fall outside PB low} LLBH:=If(cond2,H,PBH);{LLB define the recent Lowest Bar} LLBL:=If(Cond2,L,PBL); 2LBH:=If(cond2,PBH,PBH);{2LB define the 2nd lower bar count after LLB} 2LBL:=If(cond2,PBL,PBL); SP:=If(LLBL<2LBL,LLBL,2LBL);{New support when condition are met} R:=If(LLBH<2LBH,2LBH,LLBH);{New resistance when condition are met} n:=BarsSince(cond1); {To test recent bar after cond1 are met and not more than 7 bars away, the LLB and 2LB and to determine the new support and resistance} Cond4:=n<7 AND H<r AND L<llbl; LLBL:=If(cond4,L,LLBL); 2LBL:=If(cond4,LLBL,2LBL); LLBH:=If(cond4,H,LLBH); 2LBH:=If(cond4,LLBH,2LBH); Cond5:=n<7 AND H<r AND L<2LBL AND L>llbl; 2LBL:=If(cond5,L,2LBL); 2LBH:=If(cond5,H,2LBH); SP:=If(LLBL<2LBL,LLBL,2LBL);{New support when condition are met} R:=If(LLBH<2LBH,2LBH,LLBH);{New resistance when condition are met {Cond1. To Test for Pivot Bar which is the lowest bar before pullback} Cond1:=L>Ref(L,-1) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-2)>Ref(L,-3); PBH:=If(cond1,Ref(H,-1),0); PBL:=If(cond1,Ref(L,-1),0); Cond2:=Cond1 AND H<PBH;{Test for if recent bar rises but still within the PB} R:=PBH;{Resistance} SP:=PBL;{Support} Cond3:=Cond1 AND H>PBH;{Check for condition where the recent bar high fall outside PB high} HHBH:=If(cond3,H,PBH);{HHB define the recent Highest Bar} HHBL:=If(Cond3,L,PBL); 2HBH:=If(cond3,PBH,PBH);{HB define the 2nd higher bar count after HHB} 2HBL:=If(cond3,PBL,PBL); SP:=If(HHBL>2HBL,HHBL,2HBL);{New support when condition are met} R:=If(HHBH>2HBH,HHBH,2HBH);{New resistance when condition are met} n:=BarsSince(cond1); {To test recent bar after cond1 are met and not more than 7 bars away, the HHB and 2HB and to determine the new support and resistance} Cond4:=n<7 AND L<s AND h>HHbh; 2HBL:=If(cond4,HHBL,2HBL); 2HBH:=If(cond4,HHBH,2HBH); HHBL:=If(cond4,L,HHBL); HHBH:=If(cond4,H,HHBH); Cond5:=n<7 AND L<s AND H>2HBH AND H<HHbH; 2HBL:=If(cond5,L,2HBL); 2HBH:=If(cond5,H,2HBH); SP:=If(HHBL<2HBL,HHBL,2HBL);{New support when condition are met} R:=If(HHBH<2HBH,2HBH,HHBH);{New resistance when condition are met} cond4 OR cond5
alfonsine  
#3 Posted : Monday, May 31, 2010 1:49:02 AM(UTC)
alfonsine

Rank: Member

Groups: Registered, Registered Users
Joined: 5/4/2010(UTC)
Posts: 18

The formulation does not appear as it should be. I have some smaller than sign but the forum cannot accept. Can any suggest how to put "smaller than sign"
alfonsine  
#4 Posted : Monday, May 31, 2010 2:14:52 AM(UTC)
alfonsine

Rank: Member

Groups: Registered, Registered Users
Joined: 5/4/2010(UTC)
Posts: 18

Here is the latest update. {Swing Long: Track stock counters that has risen quite a far bit and the 20SMA > 50 SMA and pull back. We like to capture another upthrust after that. Entry is to break 1 bid above resistance.} {Swing Short: Track stock counters that has drop quite a far bit and the 50SMA > 20 SMA and pull back. We like to capture another downward move after that. Entry is to break 1 bid below support.} Swing Long Formulation {Cond1. To Test for Pivot Bar which is the highest bar before pullback} Cond1:=Ref(H,-1)>H AND Ref(H,-1) > Ref(H,-2) AND Ref(H,-2) > Ref(H,-3); PBH:=If(cond1,Ref(H,-1),0); PBL:=If(cond1,Ref(L,-1),0); Cond2:=Cond1 AND L>PBH;{Test for if recent bar fall within the PB} R:=PBH;{Resistance} SP:=PBL;{Support} Cond3:=Cond1 AND PBL>L;{Check for condition where the recent bar low fall outside PB low} LLBH:=If(cond2,H,PBH);{LLB define the recent Lowest Bar} LLBL:=If(Cond2,L,PBL); 2LBH:=If(cond2,PBH,PBH);{2LB define the 2nd lower bar count after LLB} 2LBL:=If(cond2,PBL,PBL); SP:=If(2LBL>LLBL,LLBL,2LBL);{New support when condition are met} R:=If(2LBH>LLBH,2LBH,LLBH);{New resistance when condition are met} n:=BarsSince(cond1); {To test recent bar after cond1 are met and not more than 7 bars away, the LLB and 2LB and to determine the new support and resistance} Cond4:=7>N AND r>H AND llbl>L; LLBL:=If(cond4,L,LLBL); 2LBL:=If(cond4,LLBL,2LBL); LLBH:=If(cond4,H,LLBH); 2LBH:=If(cond4,LLBH,2LBH); Cond5:=7>N AND r>H AND 2LBL>L AND L > llbl; 2LBL:=If(cond5,L,2LBL); 2LBH:=If(cond5,H,2LBH); SP:=If(2LBL>LLBL,LLBL,2LBL);{New support when condition are met} R:=If(2LBH>LLBH,2LBH,LLBH);{New resistance when condition are met} Swing Short {Cond1. To Test for Pivot Bar which is the lowest bar before pullback} Cond1:=L > Ref(L,-1) AND Ref(L,-1) > Ref(L,-2) AND Ref(L,-2) > Ref(L,-3); PBH:=If(cond1,Ref(H,-1),0); PBL:=If(cond1,Ref(L,-1),0); Cond2:=Cond1 AND PBH>H;{Test for if recent bar rises but still within the PB} R:=PBH;{Resistance} SP:=PBL;{Support} Cond3:=Cond1 AND H > PBH;{Check for condition where the recent bar high fall outside PB high} HHBH:=If(cond3,H,PBH);{HHB define the recent Highest Bar} HHBL:=If(Cond3,L,PBL); 2HBH:=If(cond3,PBH,PBH);{HB define the 2nd higher bar count after HHB} 2HBL:=If(cond3,PBL,PBL); SP:=If(HHBL > 2HBL,HHBL,2HBL);{New support when condition are met} R:=If(HHBH > 2HBH,HHBH,2HBH);{New resistance when condition are met} n:=BarsSince(cond1); {To test recent bar after cond1 are met and not more than 7 bars away, the HHB and 2HB and to determine the new support and resistance} Cond4:=7>N AND s>L AND h > HHbh; 2HBL:=If(cond4,HHBL,2HBL); 2HBH:=If(cond4,HHBH,2HBH); HHBL:=If(cond4,L,HHBL); HHBH:=If(cond4,H,HHBH); Cond5:=7>N AND s > LAND H > 2HBH AND HHbH>H; 2HBL:=If(cond5,L,2HBL); 2HBH:=If(cond5,H,2HBH); SP:=If(2HBL>HHBL,HHBL,2HBL);{New support when condition are met} R:=If(2HBH>HHBH,2HBH,HHBH);{New resistance when condition are met} cond4 OR cond5 Please comment if the formulation is right. I don't seem to be able to capture all the consolidation and pullback
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.