I find no errors importing the formulas from the CupAndHandle Folder using the Formula Organizer.
However, since you experience an error see at the end of this post. I have written the indicator formulas.
As far as the Exploration is concerned, check that the exploration is performed using many historical bars.
Also, when opening a chart from the Exploration results, check the periodicity of the chart and the periodicity
of the exploration. In the majority of cases the periodicities must match if you want to see the cup plotted.
Best Regards,
Giorgos E. Siligardos
e-mail:
siligard@daedalussoft.com
http://www.daedalussoft.comight;
L2:=P0+2*boxheight;
L3:=P0+3*boxheight;
L4:=P0+4*boxheight;
iscup:=
{1}cupperiod >30 AND
{2}((Cum(If( Cum(1)>b1 AND Cum(1)<b4, Log(C)>=L3,0))+
Cum(If( Cum(1)>b2 AND Cum(1)<b3, Log(C)>=L2,0)))=0) AND
{3}(((Cum(If(Cum(1)>b1 AND Cum(1)<b2, Log(L)<(L1-boxheight/3),0))>0) AND
(Cum(If(Cum(1)>b3 AND Cum(1)<b4, Log(L)<(L1-boxheight/3),0))>0)) OR
((Cum(If(Cum(1)>b0 AND Cum(1)<b1, Log(L)<(L2-boxheight/3),0))>0) AND
(Cum(If(Cum(1)>b4 AND Cum(1)<Highbar, Log(L)<(L2-boxheight/3),0))>0))) AND
{4}LLV(Log(C),handleperiod+1)>L2 ;
iscup;
Create the following Indicator which will be used to graph the function f
Name:
IsCup-Plot
Formula:
Iscup:= Fml( "IsCup") ;
P0:= FmlVar("IsCup","P0");
P1:= FmlVar("IsCup","P1");
B0:= FmlVar("IsCup","B0");
Bcenter:=(FmlVar("IsCup","B2")+FmlVar("IsCup","B3"))/2;
Handleperiod:=FmlVar("IsCup","Handleperiod");
{plot}
plotarea:=(1+BarsSince(Cum(1)>=b0))*Ref(1,LastValue(handleperiod-1));
halfper:=B0-Bcenter;
a:=(Exp(P1)-Exp(P0))/Power(If(halfper=0,1,halfper),6);
If(LastValue(iscup),plotarea,BarsSince(LastValue(iscup)))*Min(Exp(P1),(a*(Power(Cum(1)-Bcenter,6))
+ Exp(P0)*0.99));
Open The Exploration Editor and create a new exploration
Name: IsCup
Filter: Fml( "IsCup") =1
Column A:
Col. Name: CupPer
Formula: FmlVar("IsCup","CUPPERIOD")
Column B: HandlePer
Col. Name: HandlPe
Formula: FmlVar("IsCup","HANDLEPERIOD")
Column C:
Col. Name: CupHeig%
Formula: ( Exp(FmlVar("IsCup","P1")) /
Exp(FmlVar("IsCup","P0") ) -1 )*100
Open The Expert Advisor and create a new expert with name "Cup coloring". Create two Highlights which will be used to color the cup.
Color for the first Highlight:
Blue
Formula for the first Highlight:
IsCup:= Fml( "IsCup");
b0:= FmlVar("IsCup","B0");
Highbar:=FmlVar("IsCup","Highbar");
If(LastValue(IsCup),Cum(1)>=b0 AND
Cum(1)<=Highbar,0);
Color for the second Highlight:
Cyan
Formula for the second Highlight:
IsCup:= Fml( "IsCup");
Highbar:=FmlVar("IsCup","Highbar");
If(LastValue(iscup),Cum(1)>Highbar,0);
-----------------------