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

Notification

Icon
Error

Options
Go to last post Go to first unread
Futuromaniak  
#1 Posted : Wednesday, April 9, 2008 2:59:27 AM(UTC)
Futuromaniak

Rank: Newbie

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

Pls help me with formulas...
Hi
Im a newbee in metastock and I want to create a trading system based on ATR ( similar to Willders ATR system )

Im looking for someone pro to help me with these formulas (in Metastock): daily data :

Enter Long if today’s maximum will be higher than today’s open + 60%ATR from last 4 days ( not including today)
Enter Short if today’s minimum will be less than todays open +30% ATR from last 4 days ( not including today)

I;m not skilled in metastock yet so maybe some of you can write it and post it here  I will be very happy
wabbit  
#2 Posted : Wednesday, April 9, 2008 6:22:39 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)
Hi there,

Welcome to the Forum.

First. Please do not multi-post. It is against the forum rules and does nothing to get your issue resolved any faster. In fact, it often slows down responses as most members will simply ignore all of your posts. If you don't know where to post your message, take your best guess; if it is in the wrong the place, the Admin team will move it to the right place for you.

As a new MS user, please read the MS Users Manual that came with your copy of MetaStock. It is full of valuable information and will give you the very basics on how to start writing your own codes. After reading the manual, download the free Equis Formula Primer and work through the exercises contained therein. This will advance your skills to a level where you should be able to write the desired system yourself.

The purpose of this Forum is to assist members when get they stuck writing their own codes. To get a fast response, post your best attempt at coding, along with a full description of what the code is supposed to be doing and give reason why the code is not doing it is supposed to be doing. If you put the effort in yourself to try to do these things, then I am very sure some Forum member will gladly give you their time to assist.


wabbit [:D]

Futuromaniak  
#3 Posted : Monday, April 14, 2008 10:53:47 PM(UTC)
Futuromaniak

Rank: Newbie

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

is there anyone who can help me ?
uasish  
#4 Posted : Tuesday, April 15, 2008 8:42:47 AM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times
Wabbit is trying to help you,give your best shot after studying Formula Primer,he will definetly guide you but you have to try.
wabbit  
#5 Posted : Wednesday, April 16, 2008 3:49:03 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)
Futuromaniak,

Where are you having troubles with your coding of this system? How much have you managed on your own so far? If you post what you have done so far, then I am sure someone will assist and show you how to correct the code to ensure you get the results you want.

When confronted with a coding a problem, one way to solve the problem is to break the problem down into its smallest components, code each small part then gradually add the code together.

Using your first criteria as an example:
Futuromaniak wrote:
Enter Long if today’s maximum will be higher than today’s open + 60%ATR from last 4 days ( not including today)


I think the first part to code will be, "ATR from last 4 days ( not including today)"
Code:
myATR:=ref(atr(4),-1);


Now, take the second part, "today’s open + 60%ATR from last 4 days ( not including today)", but we already have part of this coded, so we actually only need, "today’s open + 60% myATR"
Code:
myPrice:=open + 0.6*myATR;


The last part, "today’s maximum will be higher than myPrice"
Code:
long:=H > myPrice;


When you put it all together:
Code:
myATR:=ref(atr(4),-1);
myPrice:=open + 0.6*myATR;
long:=H > myPrice;


Test this and see if it produces the results you want. If it does, great. If it doesn't, then go back through the parts of the code and try to figure out where the problem is occurring or needs refining. Once you have ironed out all the bugs, you might then like to consolidate the code (if you need to, otherwise just leave it):

Code:
long:=H>(open+0.6*(ref(atr(4),-1)));


Using steps like these, you should be able to solve most problems. Try working through the short entry problem in a similar fashion. Let us know how you go.


Hope this helps.


wabbit [:D]

P.S. Also, when writing your codes, try not to think in terms of the future because then you might accidentally write some code that uses forward referencing; this uses produces great theoretical results but cannot actually be traded. Where you say, "Enter Long if today’s maximum WILL BE higher than today’s open," it might be better to say something along the lines of, "enter a long trade if the high IS greater than the open" It's a small difference that might stop you making a big mistake one day. [:)]

P.P.S. All codes untested as I am not on my MS machine tonight!


arnie  
#6 Posted : Wednesday, April 16, 2008 1:53:19 PM(UTC)
arnie

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/23/2005(UTC)
Posts: 12

Hi Futuromaniak,

Your answer is in here:

http://tradersconsortium.com/community/index.php?showtopic=9522

regards
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.