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

Notification

Icon
Error

Options
Go to last post Go to first unread
wawa  
#1 Posted : Friday, November 18, 2011 4:59:37 PM(UTC)
wawa

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 7

I have a trend change indicator which has 6 different conditions that need to be triggered before the indicator will be enabled. I want to scan for the possible trend change using this indicator using the explorer. The problem is that if the trend is prolonged the indicator will be present for the same symbol for for many days (and scans) in a row. Is it possible to have the indicator written in a manner that it will show up in the scan the first day it is triggered, and ignore subsequent days if the previous day had the indicator enabled? To summarize, I want to see the first day the trend change indicator is enabled and ignore subsequent trigger days until the indicator does not enable and then start the process all over again. Hope this makes sense. Thanks in advance for any replies.
mstt  
#2 Posted : Friday, November 18, 2011 6:17:50 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 wawa

A simple technique for identifying the first bar of a TRUE signal is to test for the current bar returning a TRUE and the previous bar returning a FALSE. This allows the leading edge of a signal that is TRUE for more than one bar to be identified and subsequent TRUE results ignored until the signal goes FALSE and then TRUE again. In effect a signal gets shortened to just one bar.

Signal=TRUE AND Ref(Signal,-1)=FALSE;

This can be written in a number of different ways and for brevity my preferred method is..

Signal AND Alert(Signal=0,2); or it could be shortened further to..
Signal*Alert(Signal=0,2);

Alert() is a function that requires caution when used in an exploration. It's use when sufficient bars are loaded is OK, but it can fail to extend a signal (the FALSE result is extended by one bar in my example) if the exploration loads insufficient data to generate a result for the full duration of the Alert.

What I'm saying is that Alert(Signal,10) will not force an exploration to load 10 or more data bars. On the other hand, Ref(Signal,-9) will force the exploration to load at least 10 data bars. In fact it would probably load 13 bars because the Explorer seems to add around 30% more data that what it estimates to be the minimum requirement. Alert() is one of several functions that the Explorer ignores when the bars-to-load calculation is performed. You're unlikely to have a problem if you set the Explorer to load 500 bars or so, but if you leave it set to Minimum Records you WILL have have problems at some point.

Roy

wawa  
#3 Posted : Monday, November 21, 2011 7:57:40 AM(UTC)
wawa

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 7

Hi Roy: Thanks for your suggestions. They worked perfectly and have saved me many hours of extra work. Thanks again
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.