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

[amibroker] Re: Finding points between points



PureBytes Links

Trading Reference Links

For the respective H/L

SetBarsRequired(1000,1000);
x=Cum(1);H1=LastValue(Highest(H));L1=LastValue(Lowest(L));
point1=Cross(C,EMA(C,80));//point1 definition
point2=Cross(StochD(),70);//point2 definition
t1=LastValue(ValueWhen(point1,x));
t2=LastValue(ValueWhen(point2,x));
between=x>=Min(t1,t2) AND x<=Max(t1,t2); 
betweenLows=IIf(between,L,H1+1);betweenHighs=IIf(between,H,L1-1);
RequestedLow=LastValue(Lowest(betweenLows));
RequestedHigh=LastValue(Highest(betweenHighs));
Plot(C,"",between*3+1,64);
Plot(RequestedLow,"",4,1);Plot(RequestedHigh,"",5,1);
PlotShapes(shapeDownArrow*(L==RequestedLow),colorYellow);
PlotShapes(shapeUpArrow*(H==RequestedHigh),colorBlue);
GraphXSpace=3;
[quite interesting for AAPL]
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Graham,
> I read messages from here.
> Anyway, the only thing you need is to define well your point1 and 
> point2. Then, even if you donīt know which one came first,
> SetBarsRequired(1000,1000);
> x=Cum(1);H1=LastValue(Highest(H));
> point1=Cross(30,StochD());
> point2=Cross(StochD(),70);
> t1=LastValue(ValueWhen(point1,x));
> t2=LastValue(ValueWhen(point2,x));
> between=x>=Min(t1,t2) AND x<=Max(t1,t2); 
> betweenLows=IIf(between,L,H1+1);
> RequestedLow=LastValue(Lowest(betweenLows));
> Plot(C,"",between*3+1,64);Plot(RequestedLow,"",4,1);
> PlotShapes(shapeDownArrow*(L==RequestedLow),colorYellow);
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > Yes Dimitris that is what I am wanting to find per the original 
> loop I sent
> > out and the following email had a chart attached with an example 
of 
> the
> > consecutive highs that I want to insert the low point between. I 
> realise you
> > do not get the emails (?) so the chart is perhaps not viewable by 
> you.
> > 
> > 
> > Cheers,
> > Graham
> > http://groups.msn.com/asxsharetrading
> > http://groups.msn.com/fmsaustralia 
> > 
> > -----Original Message-----
> > From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...] 
> > Sent: Friday, 19 December 2003 3:38 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Finding points between points
> > 
> > 
> > Graham,
> > I try to understand what are you looking for, but I am confused a 
> bit. If,
> > for the last x bars, we find the topH1, the topH2 and then the 
> > lowest between them, will it be OK ?
> > Dimitris Tsokakis 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > > Thanks Jayson, unfortunately zig was an early attempt I did use.
> > Its problem
> > > is selecting the appropriate % move whiich varies greatly with 
the
> > between
> > > stock.
> > > What I guess I need is how to insert a loop within the existing
> > loop that
> > > determines if I have 2 consecutive peaks or troughs and then 
find
> > the
> > > lowest/highest price between them.
> > >  
> > > 
> > > Cheers,
> > > Graham
> > > http://groups.msn.com/asxsharetrading
> > > http://groups.msn.com/fmsaustralia
> > > 
> > > -----Original Message-----
> > > From: Jayson [mailto:jcasavant@x...]
> > > Sent: Friday, 19 December 2003 2:22 PM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: RE: [amibroker] Re: Finding points between points
> > > 
> > > 
> > > Graham,
> > >  
> > > Would the use of zig rather than HHV/LLV make sense? Finding the
> > pivots is
> > > easy and highestsince()/lowestsince() provides the values. Click
> > any spot on
> > > the chart to see the associated values.....
> > >  
> > > Regards,
> > > Jayson 
> > >  
> > > 
> > > pds=Param(" % thresh hold",5,1,50,1);
> > > 
> > > x=Zig(C,pds);
> > > HP=Ref(x,-2)<Ref(x,-1) AND x<Ref(x,-1);
> > > LP=Ref(x,-2)>Ref(x,-1) AND x>Ref(x,-1);
> > > 
> > > Plot(C,"c",1,64);
> > > 
> > > GraphXSpace=10;
> > > 
> > > Plot(Hp,"Hp",5,2|styleOwnScale);
> > > 
> > > Plot(Lp,"Lp",4,2|styleOwnScale);
> > > 
> > > Title="Lowest low "+LowestSince(Hp,L)+ " Highest High "
> > +HighestSince(Lp,H);
> > >  
> > >  
> > > -----Original Message-----
> > > From: Graham [mailto:gkavanagh@x...]
> > > Sent: Friday, December 19, 2003 12:32 AM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: RE: [amibroker] Re: Finding points between points
> > > 
> > > 
> > > Ace, I want information processed from these points, finding the
> > points is
> > > just a first step.
> > > 
> > > I think I have that boolean bit already in the loop, and finding
> > simple
> > > low-high-low is easy enough and would halve the code I sent, 
but 
> it
> > excludes
> > > any second significant point that comes along. In the chart I 
sent
> > the
> > > second high would be lost which is a significant move
> > > 
> > > I have done it in straight AFL but it becomes cumbersome and
> > limited in its
> > > use further down my track with it. What I have shown is just the
> > first part,
> > > I go onto medium and minor price moves as well that require the
> > same type of
> > > formula. I was hoping for a shorter solution than using base 
AFL.
> > > 
> > > 
> > > Cheers,
> > > Graham
> > > http://groups.msn.com/asxsharetrading
> > > http://groups.msn.com/fmsaustralia
> > > 
> > > -----Original Message-----
> > > From: acesheet [mailto:acesheet@x...]
> > > Sent: Friday, 19 December 2003 1:20 PM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] Re: Finding points between points
> > > 
> > > 
> > > Graham,
> > > 
> > > Could you try something like a simple boolean variable that 
> changes
> > > from 1 to 0 (not an array) to let you know if what you found is 
> the 
> > > next low or the next high you are looking for? You could then 
add 
> > it 
> > > as a status condition in your searching routines. In other words
> > > when searching for a low after a high has been found and then 
> > > another high is found keep storing the latest high until a low 
> > comes 
> > > along and switches the boolean to 0 (assuming it was 1 when a 
high
> > > was found).
> > > 
> > > That may help.
> > > 
> > > -ace
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> 
wrote:
> > > > I am pulling whats left of my hair on this one
> > > > I want to find the turning points for major price moves and 
make
> > > certain
> > > > that each point is alternating between high then low. If a new
> > > high is found
> > > > before a low TP and is higher than the previous high, it 
becomes
> > > the new
> > > > high TP. (similar for the lows). BUT I then want to insert a 
low
> > > (or high)
> > > > between the concurrent highs but cannot seem to get it. (the
> > > alternative
> > > > would be to remove the first TP and keep the next one)
> > > > In words just using the highs as example, find the Highest 
high
> > > for a period
> > > > of time, then search for the next lowest low, but if higher 
high
> > > is found
> > > > before the next lowest low, then it is kept (lower highs are
> > > rejected before
> > > > a low is found).
> > > > 
> > > > Can someone please help, here is the code I have so far for
> > > plotting. The
> > > > answer is probably so easy, but I feel like a first time 
novice
> > > not seeing
> > > > the forest for the trees.
> > > > 
> > > > 
> > > > //BASE CALCULATION OF TURN POINTS Plot
> (C,"",colorBlack,styleBar);
> > > > 
> > > > //Assign H & L for zero volume Bars as = Last Bar with H not= 
L 
> H
> > = 
> > > > IIf( V==0 AND GroupID()!= 1, ValueWhen( V > 0, H ), H ); L = 
IIf
> (
> > V==0 
> > > > AND GroupID()!= 1, ValueWhen( V > 0, L ), L );
> > > > 
> > > > //MAJOR TRENDS
> > > > 
> > > > //Set the intitial values for looping
> > > > MajorTop = Null;
> > > > MajorBottom = Null;
> > > > LastMajorTop = 0;
> > > > MajorResLevel = Null;
> > > > MajorSupLevel = Null;
> > > > MajorBotBar = Null;
> > > > MajorBotBar = Null;
> > > > //look backward & forward bars for trends
> > > > MajorM = Param("M",10,5,20,1);
> > > > MajorN = Param("N",50,30,80,5);
> > > > 
> > > > //DEFINE THE BACKWARD & FORWARD REQUIREMENTS
> > > > MajorHigh =
> > > > H == Ref( HHV( H, ( 2 * MajorM ) + 1 ), MajorM ) AND
> > > > H > Ref( HHV( H, MajorN ), -MajorM-1 ) AND
> > > > H > Ref( HHV( H, MajorN ), MajorM + MajorN );
> > > > 
> > > > MajorLow =
> > > > L == Ref( LLV( L, ( 2 * MajorM ) + 1 ), MajorM ) AND
> > > > L < Ref( LLV( L, MajorN ), - MajorM-1 ) AND
> > > > L < Ref( LLV( L, MajorN ), MajorM + MajorN );
> > > > 
> > > > //Loop to find MajorTops and MajorBottoms, plus price values 
of
> > > MajorTops &
> > > > MajorBottoms
> > > > for( i=1; i<BarCount-1; i++ )
> > > > {
> > > >  if( MajorHigh[i] && LastMajorTop[i-1]==0 )
> > > >  {
> > > >   MajorTop[i] = 1;
> > > >   MajorResLevel[i] = H[i];
> > > >   LastMajorTop[i] = 1;
> > > >   MajorTopBar[i] = i;
> > > >   MajorSupLevel[i] = MajorSupLevel[i-1];
> > > >  }
> > > >  else
> > > >  {
> > > >   if( MajorHigh[i] && LastMajorTop[i-1]==1 && H[i]
>MajorResLevel
> > [i-
> > > 1] )
> > > >   {
> > > >    MajorTop[i] = 1;
> > > >    MajorResLevel[i] = H[i];
> > > >    LastMajorTop[i] = 1;
> > > >    MajorTopBar[i] = i;
> > > >    MajorSupLevel[i] = MajorSupLevel[i-1];
> > > >   }
> > > >   else
> > > >   {
> > > >    if( MajorLow[i] && LastMajorTop[i-1]==1 )
> > > >    {
> > > >     MajorBottom[i] = 1;
> > > >     MajorSupLevel[i] = L[i];
> > > >     LastMajorTop[i] = 0;
> > > >     MajorBotBar[i] = i;
> > > >     MajorResLevel[i] = MajorResLevel[i-1];
> > > >    }
> > > >    else
> > > >    {
> > > >     if( MajorLow[i] && LastMajorTop[i-1]==0  && L[i]
> <MajorSupLevel
> > > [i-1] )
> > > >     {
> > > >      MajorBottom[i] = 1;
> > > >      MajorSupLevel[i] = L[i];
> > > >      LastMajorTop[i] = 0;
> > > >      MajorBotBar[i] = i;
> > > >      MajorResLevel[i] = MajorResLevel[i-1];
> > > >     }
> > > >     else
> > > >     {
> > > >      MajorSupLevel[i] = MajorSupLevel[i-1];
> > > >      MajorResLevel[i] = MajorResLevel[i-1];
> > > >      LastMajorTop[i] = LastMajorTop[i-1];
> > > >     }
> > > >    }
> > > >   }
> > > >  }
> > > > }
> > > > GraphXSpace = 5;
> > > > 
> > > > PlotShapes( MajorBottom * shapeStar, colorGreen, 0, L, 0 );
> > > > PlotShapes( MajorTop * shapeStar, colorSeaGreen, 0, H, 0 );
> > > > 
> > > > Plot( MajorSupLevel, "MajorSupTP Level", colorSeaGreen,
> > > > styleNoLine|styleDots );
> > > > Plot( MajorResLevel, "MajorResTP Level", colorBrown,
> > > styleNoLine|styleDots
> > > > );
> > > > 
> > > > 
> > > > Cheers,
> > > > Graham
> > > > http://groups.msn.com/asxsharetrading
> > > > http://groups.msn.com/fmsaustralia
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > 
> > > Yahoo! Groups Links
> > > 
> > > To visit your group on the web, go to: 
> > > http://groups.yahoo.com/group/amibroker/
> > > 
> > > To unsubscribe from this group, send an email to: 
> > > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > 
> > > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/ 
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > 
> > > 
> > > 
> > > 
> > >   _____
> > > 
> > > Yahoo! Groups Links
> > > 
> > > 
> > > *	To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/amibroker/
> > >   
> > > 
> > > *	To unsubscribe from this group, send an email to:
> > > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?
subject=Unsubscribe>
> > >   
> > > 
> > > *	Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> > Service
> > > <http://docs.yahoo.com/info/terms/> .
> > > 
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > 
> > > 
> > > 
> > >   _____
> > > 
> > > Yahoo! Groups Links
> > > 
> > > 
> > > *	To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/amibroker/
> > >   
> > > 
> > > *	To unsubscribe from this group, send an email to:
> > > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?
subject=Unsubscribe>
> > >   
> > > 
> > > *	Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> > Service
> > > <http://docs.yahoo.com/info/terms/> .
> > 
> > 
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > 
> > Yahoo! Groups Links
> > 
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/amibroker/
> > 
> > To unsubscribe from this group, send an email to:
> > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > 
> > Your use of Yahoo! Groups is subject to:  
> http://docs.yahoo.com/info/terms/


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/amibroker/

To unsubscribe from this group, send an email to:
 amibroker-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/