logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
gorachand  
#1 Posted : Wednesday, October 19, 2016 9:11:53 AM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hello, I am trying to run a simple exploration trying to find the first instance where the 20 period cci is greater than 35. I tried two methods In the filter panel I plugged in cci(20) >35 I also tried creating an indicator which plots one or zero where cci(20) >35 and then referencing that indicator in the filter-- indicator=1 Both methods are giving a delayed signal by 3-4 bars The logic and exploration is so simple that I am at my wits end as to where I am going wrong. Can anyone help? Regards, Dr.Chatterjee

Edited by user Wednesday, October 19, 2016 9:59:09 AM(UTC)  | Reason: Not specified

mstt  
#2 Posted : Wednesday, October 19, 2016 6:41:52 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Dr.Chatterjee I'm a little confused as to exactly what you are trying to achieve but I have some suggestions that might help. I've found that creating a new indicator is generally easier than creating an exploration. Typically an indicator will plot across almost an entire chart whereas an exploration generally just reports the last value. What an exploration usually cannot provide is a visible image of successive values across a chart. So creating an indicator before attempting to build an exploration is often a much more productive exercise. Here's how I would approach what I think you're trying to achieve. {Crossover Event indicator} Event:=Cross(CCI(20),35); BarsSince(Event); The "Event" variable identifies each crossing of CCI(20) above 35, and the BarsSince(Event) result returns a "zero" for each crossover and then the number of barse since the crossover, To create an exploration from the indicator I'd set it up as follows. Note that Column A has the same code as the indicator. The Filter section identifies that a crossover has just taken place. You could easily extend the filters capability to identify a crossover on any one of the most recent 5 bars by using "ColA<5" for example. {Crossover Event Exploration} {ColA: Cross} Event:=Cross(CCI(20),35); BarsSince(Event); {Filter} ColA=0; If I've not addressed the right problem then please expand your explanation. Roy
thanks 1 user thanked mstt for this useful post.
MS Support on 10/20/2016(UTC)
gorachand  
#3 Posted : Thursday, October 20, 2016 3:49:06 PM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hello Roy, Thank you for reply. The exploration works perfectly Regards, Dr.Chatterjee
gorachand  
#4 Posted : Thursday, February 2, 2017 6:13:39 PM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)

Hello Roy,

         You answered my last post on CCI exploration.I wonder if you could help me with this one?

I fashioned a custom indicator CCI with period 20.

Now I want to code an exploration where the CCI value for the current bar and the bar before it is greater than 35. The bar 2 bars ago (3rd bar counting fro current) has a CCI value  less than 35. The high of the current bar is greater than half the difference between the previous high and low added to the previous high.

I coded it thus

  Fml( "CCI") >35 AND Ref(Fml( "CCI"),-1)>35 AND
Ref(Fml( "CCI"),-2)<35 AND (H> (((Ref(H,-1)-Ref(L,-1))*.5)+Ref(H,-1)))

Plug in Filter

There seems something wrong with it. Could you please check?

Regards,

Dr.Chatterjee


Edited by user Thursday, February 2, 2017 6:34:46 PM(UTC)  | Reason: Not specified

mstt  
#5 Posted : Thursday, February 2, 2017 7:42:21 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Dr C The problem might be that you have more than 1 indicator starting with (or possibly including) the text "CC1". I'd suggest you change the name (by adding 1 or 2 characters) to make the name unique. Roy
wabbit  
#6 Posted : Friday, February 3, 2017 12:15:37 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Avoid making multiple calls to the same indicator in your Fml() and/or FmlVar() as they are slow, and makes your code harder to read and maintain.

myCCI:=Fml("CCI");

{plot}
myCCI >35 AND
Ref(myCCI,-1) > 35 AND Ref(myCCI,-2) < 35 AND

(H> (((Ref(H,-1)-Ref(L,-1))*.5)+Ref(H,-1)))

 

 

Also, cci() is a reserved name for the function... this is going to lead to trouble if you try to call a custom indicator the same name.

Edited by user Friday, February 3, 2017 12:25:48 AM(UTC)  | Reason: Not specified

gorachand  
#7 Posted : Friday, February 3, 2017 11:33:34 AM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)

Thank you wabbit-- for your reply

Regards,

Dr.Chatterjee

Users browsing this topic
Guest (Hidden)
Similar Topics
CCI exploration formula [RESOLVED] (Formula Assistance)
by moneypick 10/14/2005 5:45:56 PM(UTC)
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.