[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help needed, markus.



PureBytes Links

Trading Reference Links

hi markus.

I have modified the formula a little and it has adjustable days.
days variable.

I also created the rule so that the high has to be greater than the 
hhv to be true. same for the low being lower than the LLV.

so if you were seeking the 3rd day to be higher than the hhv3 days 
not equal to it, use 2 in the days variable and then if the 3rd day 
is higher than the first 2 days it would be true.

I have blanked out the barssince rule but you could blank out the 
z==1 or y==1 lines to use the barssince lines as a comparison.

also with the charting i have charted the value lines of the high 
and low true cond and the bar outlines will change colour at that 
point as well.

this looks a little better as with only using the llv or hhv 
because the high can be at the same high price for 3 days and be 
true, where as you wanted the high to be higher than the previous 
highs.
 
days=2;

z=IIf(L==LLV(Low,Days),1,0);
Y=IIf(H==HHV(High,Days),1,0);
Cc=ValueWhen(z==1,L,1);
dd=ValueWhen(y==1,H,1);


Oo=IIf(H>Ref(dd,-1),1,0);//h
pp=IIf(L<Ref(Cc,-1),1,0);//l

//z1=BarsSince(pp==0);//l
//y1=BarsSince(Oo==0);//h
z1=z==1;
y1=y==1;


ff=ExRem(z1==1,y1==1);//l
Hh=ExRem(y1==1,z1==1);//h
Hh1=ExRem(Hh,ff);//l
ff1=ExRem(ff,Hh);//h

kk=ValueWhen(ff==1,L,1);//l
Ll=ValueWhen(Hh==1,H,1);//h

mmm=IIf(hh1==1,6,IIf(ff1==1,7,1));

Plot(C ,"",mmm,64);//l
Plot(C,"",1,64);
Plot(kk,"",7,4);
Plot(ll,"",6,4);

AddColumn(z,"z");
AddColumn(y,"y");
AddColumn(Hh1,"hh1");
AddColumn(ff1,"ff1");
AddColumn(kk,"kk");
AddColumn(Ll,"ll");


Buy=C;
Filter=1;


cheers: john.






--- In amibroker@xxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> Dear John,
> 
> I am awaiting the chart which might enmable me to follow your 
explanations
> more easily.
> 
> Wow - youīve put so much time in MY thing that I hope I somehow 
will be able
> to make up for it. Somehow, swing trading apparently isnīt used 
that much by
> the members of this forum...
> 
> Please take your time and donītr put yourself in a hurry because of 
me. I
> really appreciate your effort!
> 
> A big THAAAAAAANNNXXXX!
> 
> Markus
> ----- Original Message -----
> From: "john thompson" <nirvanaiam@xxxx>
> To: <amibroker@xxxx>
> Sent: Friday, June 21, 2002 9:18 PM
> Subject: [amibroker] Re: Help needed, markus.
> 
> 
> > Hi markus.
> > I have attached a chart to help explain the formula.
> >
> > (Sorry i will attach it tommorrow having probs with
> > attachments on yahhoo at the moment)
> >
> >
> > note: i dont know to much about swing trading and
> > probably needed feedback as to if the formula i posted
> > was what you wanted.
> >
> > The difference with
> > (Why did you use z1=BarsSince(z==0); instead of z==1?
> > Didnīt you want to
> > detect where the 3D low occurred?)
> >
> >
> > the use of the z1=BarsSince(z==0) is because when in
> > this part of the formula,
> > z=IIf(L==LLV(Low,3),1,0);
> > Y=IIf(H==HHV(High,3),1,0);
> >
> > is not true it will be 0, so when i later ask for
> > z1==1 this will be the first day that the condition of
> > z was true.
> > because the barssince function will count the number
> > of bars (in this example) since z==0, so when its not
> > 0 it =1 and it will start counting the days it is
> > true until it is 0 again. (cond not true).
> >
> >
> >
> > assume the Y=IIf(H==HHV(High,3),1,0); was true for
> > 10 days,
> > I want the first day this occured, then on the 3rd
> > day while the high cond is still true the
> > z=IIf(L==LLV(Low,3),1,0); condition triggers, but only
> > stays true for 1 day, the high is still true for 7
> > more days and wont trigger again until its true after
> > a 0.
> >
> > the charts i have posted show the diferent formulas
> > using barssince or the z==1 .
> >
> > the lower chart uses the barssince rule.
> >
> > you will notice on the upper chart the low and high
> > also can trigger on the same day using the z==1 or
> > y==1 rule.
> >
> > this may be what you want but i wasnt sure of what
> > you were asking.
> >
> > these lines of the formula
> > Cc=ValueWhen(z1,L,1);
> > dd=ValueWhen(y1,H,1);
> >
> > which were not plotted was left in the formula if you
> > wanted to compare it against the blue and red value
> > lines which are in order.
> > so cc and dd if plotted would be the order they
> > occured naturally.
> >
> > The exrem
> > ff=ExRem(z1==1,y1==1);//l
> > Hh=ExRem(y1==1,z1==1);//h
> > was used to create the order you wanted, so a z
> > condition will be followed by the y condition then a z
> > condition e.t.c. of course in my formula it is the
> > first day the cond was true, as explained earlier.
> >
> > I had to exrem this again
> > Hh1=ExRem(Hh,ff);//l
> > ff1=ExRem(ff,Hh);//h
> >
> > for some reason i dont understand yet because the
> > first exrem conds, when plotted came up with a few z
> > cond followed by a z cond, so the order was out, so i
> > just exremed again which worked.
> >
> > the red horizontal value lines which change when a
> > true occurs are the high value lines.
> >
> > the blue horizontal value lines which change when a
> > true occurs are the low value lines .
> >
> > the red and blue vertical lines are the same points
> > where the true conds occured)as on the horizontal
> > lines but make it
> > easier to see where the cond occured.
> >
> >
> >
> > these lines below were only for plotting the vertical
> > lines in the chart.
> > mm=Cross(Hh1,0.1);//h
> > mmm=IIf(Cross(Hh1*1.001,1.00),4,2);//h
> >
> > nn=Cross(ff1,0.1);//l
> > nnn=IIf(Cross(ff1*1.001,1),6,2);//l
> > Plot(nn+L-1,"",nnn,6);//l
> > Plot(MM+H-1,"",mmm,6);//h
> >
> > it affects the scaling of the price bars in the chart
> > a little and have changed it to this.
> >
> > yyy=IIf(BarsSince(ff1 )==0,6,0);
> > xxx=IIf(BarsSince(Hh1 )==0,4,0);
> >
> >
> > Plot(L*0.95,"",yyy,14);
> > Plot(L*0.99,"",xxx,14);
> >
> >
> > i only plotted these vertical lines to make it easier
> > to see where the cond occured you dont need to use
> > them.
> >
> >
> >
> > cheers: john.
> >
> >
> >
> >
> >
> > http://www.sold.com.au - SOLD.com.au
> > - Find yourself a bargain!
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/
> >
> >