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

Notification

Icon
Error

Options
Go to last post Go to first unread
EMA Trader  
#1 Posted : Wednesday, September 29, 2010 4:25:22 AM(UTC)
EMA Trader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/29/2010(UTC)
Posts: 5

Hi all, I am a proud new owner of MS 11 and I am in need of some help on some very basic coding (I'm almost a little ashamed to have to ask). I have read the Formula Primer and viewed the available video tutorials on the Equis website but am still at a loss as to how to correctly code a simple exploration. What I want to do is to run an exploration that will find all the stocks that have closed above the 20 period variable moving average for the first time since trading below it, i.e. the price has made a fresh cross and closed above it. So, for example. If yesterdays close was the first time the price closed above the 20 day variable moving average, I want the explorer to highlight this stock and for it to eliminate all those other stocks where the price is already above the 20 day variable moving average. Does that make sense? I am currently using the below coding and this is returning all stocks that have previously closed above the 20 period variable moving average rather than those that have made a fresh close above it for the first time since trading below it. C>Mov(C,20,VAR) If anyone could spare a few moments to help a coding newbie out it would be gratefully received. Many thanks, Please note that I don't have a hard copy of the users manual as I have a monthly subscription and downloaded the programme from Equis directly.
wabbit  
#2 Posted : Wednesday, September 29, 2010 6:05:14 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)
The simplest solution is to use the Cross() function:

Code:

Cross(C,Mov(C,20,VAR));



wabbit [:D]

EMA Trader  
#3 Posted : Wednesday, September 29, 2010 6:54:05 AM(UTC)
EMA Trader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/29/2010(UTC)
Posts: 5

Thanks for the quick reply wabbit. I have run the exploration on a list of stocks and I have a number of stocks that have been falsely reported. The stocks have indeed closed above the vma but the actual day it closed above it for the first time is more than 1 day ago. Is there a way of filtering out these false stocks? Ultimately I want to run two explorations, one for stocks with a fresh new close above the vma and one for stocks with a fresh new close below the vma. Thanks
wabbit  
#4 Posted : Wednesday, September 29, 2010 8:01:11 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)
The exploration will return only those stocks where the Cross() function returns TRUE. If you're getting "odd" results, then load more data into the exploration (uncheck "load minimum records" and load AT LEAST 100 bars) and re-run.


wabbit [:D]

EMA Trader  
#5 Posted : Wednesday, September 29, 2010 8:37:07 AM(UTC)
EMA Trader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/29/2010(UTC)
Posts: 5

Excellent, thanks wabbit. 6 stocks found and all 6 are true - perfect. Now onto my next task of creating two new explorations, one to find stocks that have made a fresh close above the vma and one to find stocks that have made a fresh close below the vma. I assume the coding will be very similar, are you able point me towards a resource where I can try and figure it out. Many thanks for your time in helping me wabbit.
henry1224  
#6 Posted : Wednesday, September 29, 2010 2:26:03 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
in col a insert Cross(C,Mov(C,20,VAR)) {will show stocks crossing above the VMA}

in col B insert Cross(Mov(C,20,VAR),C) {will show stocks crossing below the VMA}

in the filter section insert Col A>0 or Col B>0 {will only show stocks that meet the conditions of Col A and Col B}


now for another way

In Col A insert If(Cross(C,Mov(C,20,VAR)),1,If(Cross(Mov(C,20,VAR),C),-1,0))
{this will show a +1 for stocks crossing above the VMA,-1 for stocks crossing below the VMA}

in the filter section insert ColA<>0
EMA Trader  
#7 Posted : Thursday, September 30, 2010 2:40:46 AM(UTC)
EMA Trader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/29/2010(UTC)
Posts: 5

Hi henry1224,

Wow, thanks for the help, I doubt I would have been able to work that out with my current level of coding ability.

With the first method I am presented with the following error message relating to the coding in filter tab.

"This is not a recognized name, constant or operator."

Any idea what this means?

Thanks again.

henry1224  
#8 Posted : Thursday, September 30, 2010 2:53:59 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
instead of Col A>0 or Col B>0

try

ColA>0 or ColB>0

but I would like you to try my second option, it will save you an exploration column
EMA Trader  
#9 Posted : Friday, October 1, 2010 2:04:17 AM(UTC)
EMA Trader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/29/2010(UTC)
Posts: 5

Excellent,

Thanks henry1224, both methods are working a treat.

[:)]

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.