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

[amibroker] Re: What smells like a bear



PureBytes Links

Trading Reference Links

Here is a 3-digit model

Plot(10,"",1,1);Plot(0,"",1,1);Plot(20,"",1,1);
Color=colorBlack;space=5;
//1st
event=Cum(1)%10==0;
Counter=Cum(event); 
shape0 = shapeDigit0 + 2 * (Counter%10);
PlotShapes(event*shape0,color,0,Graph0,space);
//2nd
event1=Cum(event)%10==0 AND Ref(Cum(event)%10,-1)!=0;
Counter1=Cum(event1);
shape1 = shapeDigit0 + 2 * ( Counter1%10 ) ;
PlotShapes(event*shape1,color,0,Graph0,space+10);
//3rd
event2=Cum(event1)%10==0 AND Ref(Cum(event1)%10,-1)!=0;
Counter2=Cum(event2);
shape2 = shapeDigit0 + 2 * ( Counter2%10 ) ;
PlotShapes(event*shape2,color,0,Graph0,space+20);

or its alternative without insignificant zero digits [instead of 018 
it will be simply 18]

 Plot(10,"",1,1);Plot(0,"",1,1);Plot(20,"",1,1);
Color=colorBlack;space=5;
//1st
event=Cum(1)%10==0;
Counter=Cum(event); 
shape0 = shapeDigit0 + 2 * (Counter%10);
PlotShapes(event*shape0,color,0,Graph0,space);
//2nd
event1=Cum(event)%10==0 AND Ref(Cum(event)%10,-1)!=0;
Counter1=Cum(event1);
shape1 = IIf(counter1==0,shapeNone,shapeDigit0 + 2 * ( Counter1%
10 )) ;
PlotShapes(event*shape1,color,0,Graph0,space+10);
//3rd
event2=Cum(event1)%10==0 AND Ref(Cum(event1)%10,-1)!=0;
Counter2=Cum(event2);
shape2 = IIf(counter2==0,shapeNone,shapeDigit0 + 2 * ( Counter2%
10 )) ;
PlotShapes(event*shape2,color,0,Graph0,space+20);

The initial event could be any binary condition [an MACD cross for 
example]

//Stochastic Crosses Counter
Plot(10,"",1,1);Plot(0,"",1,1);
Color=colorBlack;space=5;
Indicator=StochD();Plot(Indicator,"",2,8);
Level=50;Plot(Level,"",1,1);
event=Cross(Indicator,Level);
//1st
Counter=Cum(event); 
shape0 = shapeDigit0 + 2 * (Counter%10);
PlotShapes(event*shape0,color,0,Graph0,space);
//2nd
event1=Cum(event)%10==0 AND Ref(Cum(event)%10,-1)!=0;
Counter1=Cum(event1);
shape1 = IIf(counter1==0,shapeNone,shapeDigit0 + 2 * ( Counter1%
10 )) ;
PlotShapes(event*shape1,color,0,Graph0,space+10);
//3rd
event2=Cum(event1)%10==0 AND Ref(Cum(event1)%10,-1)!=0;
Counter2=Cum(event2);
shape2 = IIf(counter2==0,shapeNone,shapeDigit0 + 2 * ( Counter2%
10 )) ;
PlotShapes(event*shape2,color,0,Graph0,space+20);

I hope the repetitive mechanism for 4th, 5th etc digits is clear.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Bill,
> It is already used in the InspectionPoints and all these topX 
studies.
> Here is a solution
> startIP=DateNum()>1030000 AND Ref(DateNum(),-1)<1030000;
> x=10;
> EVENT=BarsSince(startIP)%x==0;
> Plot(50,"",1,1);Plot(100,"",1,1);
> shape=33+2*(Cum(event)%10);
> PlotShapes(shape*EVENT,colorIndigo);
> Plot(0,"",1,1);
> shape1=33+2*(floor(Cum(event/10))%10);
> PlotShapes(shape1*EVENT,colorIndigo,0,Graph0,10);
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <wd78@xxxx> wrote:
> > As far as I can tell, it is not possible to concatenate two or 
more 
> shapeDigit parameters to produce a multi-digit number (i.e., 
> shapeDigit 3 + shapeDigit3 != 33).  Has anyone found a work around 
> for this?
> > 
> > Bill



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/