PureBytes Links
Trading Reference Links
|
SB's multi study.
Note: no profitability is assumed or implied with these systems.
Code is for demonstration purposes only.
**********************
//new and improved multi study test
//1. Define variables
ticker=Name();
GraphXSpace=15;
PlotOHLC(O,H,L,C,"close ",colorWhite,styleBar|styleThick);
GARBAGE=1;
Days=0;
range=0;
Oversold=30;
Overbought=70;
Color=colorBlack;
Buy=Sell=Short=Cover=0;
stop=10.5;//stop value
stoptype=0;// maximum stop loss (non trailing, not profit following)
stopmode=1;// stop disable =0, stop enable %=1
//2. Define callable functions
function PlotMA(Days)//plots the individual MA per security
{Plot(MA(C,Days),"MA ",colorBlue,styleLine);};
function plotwhip(range,bottom,top)//plots an individual RSI per
security
{
//purpose of dividing by 5 is to scale to the bottom of the screen.
result2=RSI(range);
result3=result2/5;
Plot(result2,"RSI
Value ",colorRed,styleLine|styleOwnScale|styleNoDraw,0,100);
Plot
(result3,"/5",colorRed,styleLine|styleOwnScale|styleNoLabel,0,100);
Plot(top,"Overbought sell
trigger ",colorRed,styleLine|styleNoDraw|styleOwnScale,0,100);
Plot
(top/5," ",colorRed,styleDots|styleNoLine|styleNoLabel|styleOwnScale,
0,100);
Plot(bottom,"Oversold buy
trigger ",colorRed,styleLine|styleNoDraw|styleOwnScale,0,100);
Plot
(bottom/5," ",colorRed,styleDots|styleNoLine|styleNoLabel|styleOwnSca
le,0,100);
};
function arrows(b,s)//plots buy/sell arrows
{
shape=Buy*shapeUpArrow+Sell*shapeDownArrow;
PlotShapes(shape,IIf(B,colorBrightGreen,colorRed),0,IIf(B,Low,High));
};
function tradema(Days,stop)//calculates the trading of the Moving
Average
{
Buy=Cross(C,MA(C,Days));
Sell=Cross(MA(C,Days),C);
ApplyStop(stoptype,stopmode,stop,True);
Equity(1);
//plot(sell==1,"applystopsell",colororange,1|styleownscale);
//plot
(cover==1,"applystopcover",coloryellow,1|styleownscale|stylenoline);
arrows(Buy,Sell);
};
function tradewhip(range,bottom,top,stop) //calculates the trading
of the RSI indicator
{
Buy=Cross(bottom,RSI(range));
Sell=Cross(RSI(range),top);
ApplyStop(stoptype,stopmode,stop,True);
Equity(1);
//Plot(Sell,"applystopsell",colorOrange,1|styleOwnScale);
//Plot(Cover,"applystopcover",colorYellow,1|styleOwnScale);
arrows(Buy,Sell);
};
//3. Select correct analysis & call trading subroutines
if (ticker=="AXP")
{Days=4;stop=2;PlotMA(Days);tradema(Days,stop);}
else {GARBAGE==1;}
if (ticker=="GM")
{Days=34;stop=4;PlotMA(Days);tradema(Days,stop);}
else {GARBAGE==1;}
if (ticker=="JPM")
{Days=5;stop=20;PlotMA(Days);tradema(Days,stop);}
else {GARBAGE==1;}
if (ticker=="IGT")
{
range=4;
Overbought=87;
Oversold=44;
stop=10.5;
plotwhip(range,Oversold,Overbought);
tradewhip(range,Oversold,Overbought,stop);
}
else {GARBAGE=1;}
if (ticker=="DMN")
{
range=5;
Overbought=62;
Oversold=43;
stop=100;
plotwhip(range,Oversold,Overbought);
tradewhip(range,Oversold,Overbought,stop);
}
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|