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

Notification

Icon
Error

Options
Go to last post Go to first unread
jassieotal  
#1 Posted : 8 years ago
jassieotal

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 9/11/2016(UTC)
Posts: 4

Thanks: 2 times

Hi Folks,

How can i find the consecutive past days which have been engulfed by the last day's canclestick? For example engulfingbear()/engulfingbull() scans for stocks where the pattern apperated on the last day. If the 2 prvious days were engulfed by the LAST CANDLESTICK, the formula generates a 2 and so on.

 

Thanks!

MS Support  
#2 Posted : 8 years ago
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)

There might be a way to combine some of the formulas, but these should meet your criteria looking at the last 3 periods.

Column A: Bull 1

X:=1;
C > O AND C > Ref(O,-X) AND O < Ref(C,-X) AND Ref(C,-X) < Ref(O,-X)

Column B: Bull 2

X:=2;
C > O AND C > Ref(O,-X) AND O < Ref(C,-X) AND Ref(C,-X) < Ref(O,-X)

Column C: Bull 3

X:=3;
C > O AND C > Ref(O,-X) AND O < Ref(C,-X) AND Ref(C,-X) < Ref(O,-X)

Column D: Bear 1

X:=1;
C < O AND C < Ref(O,-X) AND O > Ref(C,-X) AND Ref(C,-X) > Ref(O,-X)

Column E: Bear 2

X:=2;
C < O AND C < Ref(O,-X) AND O > Ref(C,-X) AND Ref(C,-X) > Ref(O,-X)

Column F: Bear 3

X:=3;
C < O AND C < Ref(O,-X) AND O > Ref(C,-X) AND Ref(C,-X) > Ref(O,-X)

Edited by user 8 years ago  | Reason: Not specified

thanks 1 user thanked MS Support for this useful post.
jassieotal on 11/15/2016(UTC)
jassieotal  
#3 Posted : 8 years ago
jassieotal

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 9/11/2016(UTC)
Posts: 4

Thanks: 2 times

Thanks for the formulas. But I was looking for something along the lines..

 OL := OPEN

 CL:= CLOSE

COND := OL< Ref(open,-x)

cum(COND)

Basically, I need to count the number of days backwards for which the current canclestick engulfs the prior ones. Your formulas does that (only for 3 days). How would i know if for example the last candle engulfs 9 previous candles?

Thanks!

MS Support  
#4 Posted : 8 years ago
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Currently this is not possible (without a DLL) as it would require the REF variable to increase dynamically while summing up the condition. This is something we will be looking at as we re-work the formula language in future versions. That said, in this particular example I think the condition is rare enough that you will not see it exceed this number too often.
Users browsing this topic
Guest (Hidden)
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.

information You have 1 unread message(s) in your Inbox.