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

Notification

Icon
Error

Options
Go to last post Go to first unread
smackdabble  
#1 Posted : Tuesday, February 23, 2010 4:48:35 PM(UTC)
smackdabble

Rank: Newbie

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

I am using a MA to provide buys and sells in the Enahnced System Tester. I want the first bar in the period being assessed to be a buy. Having problems making this happen.
v.trader  
#2 Posted : Tuesday, February 23, 2010 5:45:41 PM(UTC)
v.trader

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2009(UTC)
Posts: 76
Location: Toronto, Canada

Hi, Do you mean the first period of the chart to be a buy ? VT
smackdabble  
#3 Posted : Tuesday, February 23, 2010 7:06:15 PM(UTC)
smackdabble

Rank: Newbie

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

Yes. For example, when the beginning of the period is 1/1/1990 and the buy signal is c>mov(c,12,s), the Enahnced System Tester doesn't register a buy until after the 12 periods needed to calculated the formula. I would like to begin the period holding the security I am testing, not waiting a year for the calculation.

v.trader  
#4 Posted : Tuesday, February 23, 2010 7:30:27 PM(UTC)
v.trader

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2009(UTC)
Posts: 76
Location: Toronto, Canada

Hmm, yes I see what you mean. I guess that is one(of the many) bugs in the system tester.. One solution that I found was that the earliest you could enter a trade is 1 day after the ma period. (i guess when an ma calculation is put forth metastock starts the bar count from the begining of the existent MA). So following up on the example in the buy order you could write: C>Mov(c,12,S) OR cum(1)=13 {prd in MA + 1} Maybe a more experienced user of Metastock can comment further. Hope it helps to some extent, VT
oztrader  
#5 Posted : Wednesday, February 24, 2010 1:48:57 AM(UTC)
oztrader

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 7/12/2007(UTC)
Posts: 134
Location: Perth Western Australia

Hi smackdabble,

The attached code to plot the SMA Indicator value from the 1st bar and the Trigger Explorer / Indicator which will indicate when the Close crosses higher than the SMA should give you what you need, however to run this code you will need to 1st download and install the Forum.DLL.

You can find the DLL under the Files tab situated on the black bar near the top of the page or use the links below. The 1st link is to the DLL whereas the 2nd link is too the reference manual.

http://forum.equis.com/files/3018/programming_files/entry19695.aspx

http://forum.equis.com/files/3018/programming_files/entry19696.aspx

{Modified SMA Indicator}
Data:=CLOSE;
Count:=Cum(1);
Test:=If(Count<=11,Count,(Count+12)-Count);
ExtFml("Forum.Sum",C,Test)/Test;


{Trigger Exploration / Indicator}
Data:=CLOSE;
Count:=Cum(1);
Test:=
If(Count<=11,Count,(Count+12)-Count);
SMA:=ExtFml("Forum.Sum",C,Test)/Test;
Cross(C,SMA)

Cheers,

oz

smackdabble  
#6 Posted : Wednesday, February 24, 2010 3:52:35 AM(UTC)
smackdabble

Rank: Newbie

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

Thanks for your help VT
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.