Discussions
»
Product and Service Development
»
Formula Assistance
»
Is it possible to explore a set of rules for a given time period
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/10/2013(UTC) Posts: 6
|
Hi,
Is it possible to explore a set of rules for a given time period.
for eg. 1. i have a list of 500 stocks 2. my condition is rsi>70 3. i want to check that for how many stocks the rsi went above 70 in the whole of 2013
Regards
|
|
|
|
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 are probably several ways you could accomplish this, including using the Alert() function.
You could probably use the ValueWhen() function as well to make it a little more dynamic, although this is probably a less standard way to use ValueWhen(). In the Filter tab, you could type:
ValueWhen(1,RSI(14)>70 AND Year()=2013,RSI(14)>70)
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/10/2013(UTC) Posts: 6
|
Thank You so much for the reply.
Actually i want to back test or atleast calculate how many entry signals i get from a particular set of rules. But the explorer would only let me check for a given particular date, whereas i want to check a full year or a range of data. Is there a way for that ?
Regards Amar
|
|
|
|
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 Amar
You can use the Cum() function to count the total number of signals or the total number of bars that a signal is TRUE. Depending on what you want it might be necessary to reduce your existing Entry signal to the leading edge only (thereby counting the transitions from FALSE to TRUE but ignoring the second and subsequent contiguously TRUE bars). Reducing each signal to just one bar is simple - give your signal a name ("MySignal" in the example below) and then add a new line of code that essentially says "MySignal TRUE on the current bar and FALSE on the previous bar".
MySignal:= "your definition" ; MySignal=TRUE AND Alert(MySignal,2)=FALSE;
The last line can be shortened somewhat to -
MySignal * (Alert(MySignal,2)=0);
Obviously you will need to set the number of bars to load so that the necessary amount of historical data is available to the exploration. Typically most entry signals will generate N/A results for a certain number of bars, so it might be useful to load additional data and use a Date Filter indicator to limit the date range that you are testing.
Roy
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Is it possible to explore a set of rules for a given time period
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.