Discussions
»
Product and Service Development
»
Formula Assistance
»
Is it possible to choose b/w 2 indicators as an input?
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 8/22/2005(UTC) Posts: 30
|
I'm not sure how to word this question but here goes. I've created a custom indicator and I could use some help on the input section.
I would like to be able to choose between two functions within this user defined indicator: - namely either a standard CCI(pds) or the Equis CCI indicator CCIE(pds).
Both have a choice of input periods.
I don't get error messages but I just get a flatline chart on the zero line. I should get periodic +1 values representing a signal.
The formula code works individually, however the code does not work when trying to splice a choice between two indicators:
{input section}
pds:=Input("CCI periods",2,50,14);
ccimthd:=Input("CCI Method",1,2,1);
If(ccimthd =1, CCI(14), CCIE(pds)) AND
{standard ZLR Rules}
ccimthd<130 AND
ccimthd>Ref(ccimthd,-1)AND
ccimthd>0 AND
Ref(ccimthd,-1)>0 AND
Ref(ccimthd,-2)>0 AND
Ref(ccimthd,-3)>0 AND
Ref(ccimthd,-4)>0 AND
Ref(ccimthd,-5)>0
Thx for any help,
Joe
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Try This:
{input section}
pds:=Input("CCI periods",2,50,14);
ccimthd:=Input("CCI Method",1,2,1);
DA:=If(ccimthd =1, CCI(14), CCIE(pds));
DA<130 AND
DA>Ref(DA,-1)AND
Sum(DA>0,6)=6
Patrick :mrgreen:
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Joe-
R U meaning to keep the CCI() constant with CCI(14) or do you want it variable too? Perhaps like this:
DA:=If(ccimthd =1, CCI(pds), CCIE(pds));
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 8/22/2005(UTC) Posts: 30
|
thanks to both -
I should have used (pds) in both functions and the addtion of the DA variable and streamlined code worked like a charm
Regards,
Joe
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Is it possible to choose b/w 2 indicators as an input?
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.