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

Notification

Icon
Error

Options
Go to last post Go to first unread
jc2009  
#1 Posted : Tuesday, February 24, 2009 4:27:38 AM(UTC)
jc2009

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/24/2009(UTC)
Posts: 2

I did read Brown's book recently. She advised how to add Volatiliy Bands on RSI but the formula is in Tradestation format. Here is the formula:

INPUT:COEFDWN(2.1),COEFUP(2.3);
PLOT1((AVERAGE((RSI(CLOSE,14)),6))+(COEFUP*(AVERAGE(TRUERANGECUSTOM((RSI(CLOSE,14)),(RSI(CLOSE,14)),(RSI(CLOSE,14))),15))),"PLOT1");
PLOT2((AVERAGE((RSI(CLOSE,14)),6))-(COEFDWN*(AVERAGE(TRUERANGECUSTOM((RSI(CLOSE,14)),(RSI(CLOSE,14)),(RSI(CLOSE,14))),15))),"PLOT2");
PLOT3((RSI(CLOSE,14)),"PLOT3");
IF CHECKALERT THEN BEGIN
IF PLOT1 CROSSES AVOVE PLOT2 OR PLOT1 CROSSES BELOW PLOT2
OR PLOT1 CROSSES AVOVE PLOT3 OR PLOT1 CROSSES BELOW PLOT3
OR PLOT2 CROSSES AVOVE PLOT3 OR PLOT2 CROSSES BELOW PLOT3
THEN ALERT=TRUE;
END;

Can anyone know how to change it to Metastock format?

Many thanks!

wabbit  
#2 Posted : Tuesday, February 24, 2009 5:05:46 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 jc,

Welcome to the forum.

Firstly, I strongly encourage you to read the MS Users Manual thoroughly and then download and complete the exercises in the free Equis Formula Primer (from the files section of the forum). Armed with this knowledge and a full understanding of what the code above is trying to do, you will be able to code this easily yourself. If you get stuck writing your codes, post your best attempt here on the forum and someone will volunteer their time to help you; the more work you do yourself, (usually) the faster someone will lend assistance.

I mentioned the code and what it is "trying" to do, because IMHO it does not do what it is supposed to be doing very well! The use of the EasyLanguage TRUERANGECUSTOM() function with the same argument in each of the three positions is redundant and more easily written as the distance of the indicator on the current bar from the previous bar. (This reinforces a point I have been trying to make for a long time: NEVER take code for granted and never take it without fully understanding how it works).

I haven't coded the alerts; you can do that yourself, but the basic code goes something like this:

---------

coefdn:=2.1;
coefup:=2.3;

rs:=RSI(C,14);
ch:=Abs(ROC(rs,1,$));

ub:=Mov(rs,6,S) + coefup*Mov(ch,15,S);
lb:=Mov(rs,6,S) - coefdn*Mov(ch,15,S);

{plot in new window}
ub;
lb;
rs;

---------


Hope this helps.

wabbit [:D]


jc2009  
#3 Posted : Tuesday, February 24, 2009 7:12:09 AM(UTC)
jc2009

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/24/2009(UTC)
Posts: 2

Hi Wabbit,

Thank you for your help and the code. It works perfectly.

Your advice is appreciated. I will download some exercises to do for enhancing my knowledge of the code.

JC

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.