[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Simple TRIX Crossover system question



PureBytes Links

Trading Reference Links




<FONT 
face=Arial color=#0000ff size=2>Pal,
 
Here is a start for you. The code below 
does not make a lot of sense to me. Your condition 1 translates to "C> a 
triple smoothed 1 day Rate of change of the Close."  That is like saying " 
I will change the oil in my car when my wife burns a pie" To see what I mean 
plot the trixline3. does that number have a relationship to the closing value of 
the stock or future under study? If what you are after is crosses of the 
smoothed ROC change "C" with Roc(c,1) and the MA with your 
tema
<SPAN 
class=154031605-24112003><FONT face=Arial color=#0000ff 
size=2>cond1=ma(c,9)>ma(c,50) and c>ma(c,80);
<FONT face=Arial color=#0000ff 
size=2>cond2=ma(c,9)<ma(c,50) and c>ma(c,80);
<FONT face=Arial color=#0000ff 
size=2>Cond3=ma(c,9)<ma(c,50) and c<ma(c,80);
 
<FONT face=Arial color=#0000ff 
size=2>buy=cond1;
<FONT face=Arial color=#0000ff 
size=2>sell=cond2;
<FONT face=Arial color=#0000ff 
size=2>short=cond3;
<FONT face=Arial color=#0000ff 
size=2>cover=cond4; 
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: palsanand 
[mailto:palsanand@xxxxxxxxx]Sent: Monday, November 24, 2003 12:12 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Simple 
TRIX Crossover system question
1. Start with a simple moving average crossover (nine-day and 50-day) 
2. Refinement 1: Add a third moving average (80-day) as a 
filter.Apply the indicator using the following rules: 1. Go long 
when 9d > 50d and close > 80d 2. Go flat when 9d < 50d and close 
> 80d 3. Go short when 9d < 50d and close < 80d 4. Go flat when 
9d > 50d and close < 80d 5. Refinement 2: Trade a diversified group of 
futures markets.How do I modify the code below to adhere to the rules 
above and how do I get sell signal arrows on the graph?//C 
= Foreign("COMPQX", "C");Trixline1=TEMA(TEMA(TEMA(ROC(C, 1), period1), 
period1), period1);Plot(Trixline1, "TRIX", colorBlue, 
styleHistogram);Trixline2=TEMA(TEMA(TEMA(ROC(C, 1), period2), period2), 
period2);Plot(Trixline2, "TRIX", colorYellow, 
styleHistogram);Trixline3=TEMA(TEMA(TEMA(ROC(C, 1), period3), period3), 
period3);Plot(Trixline3, "TRIX", colorGreen, styleHistogram);Cond1 = C 
> TrixLine3;Cond2 = C < TrixLine3;"The bmTRIX is indicating a " 
+WriteIf(Trixline1 > Trixline2 AND C > TrixLine3, "bullish", 
"bearish") +" market environment because it is " +WriteIf(TrixLine1 > 
Trixline2 AND C < TrixLine3, "above", "below") +" the zero 
line.\n";Buy = Cover = Cross( TrixLine1,TrixLine2 ) AND (C > 
TrixLine3);Sell = Short = Cross( TrixLine2,TrixLine1 ) AND (C < 
TrixLine3);shape = Buy * shapeUpArrow + Sell * 
shapeDownArrow;PlotShapes(IIf(Buy,shapeUpArrow,shapeNone) 
,colorBrightGreen,0,Graph1,-15); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1,-15); 
//PlotShapes(IIf(Buy,shapeUpArrow,shapeNone) 
,colorBrightGreen);//PlotShapes(IIf 
(Sell,shapeDownArrow,shapeNone),colorRed);GraphXSpace=10; //Sell = 0 
; // exit only by stopsApplyStop( stopTypeProfit, stopModePercent, 30, 
ExitAtStop = True, Volatile = False, ReentryDelay = 0 );ApplyStop( 
stopTypeTrailing, stopModePercent, 20, ExitAtStop = True, Volatile = False, 
ReentryDelay = 0 );Equity(1); // THIS EVALUATES STOPSTitle = Name() + ": 
" + Date() + " Open " + WriteVal(O,1.4) + " Hi " +WriteVal(H,1.4) + " Lo 
"+WriteVal(L,1.4) + "  Close " + 
WriteVal(C,1.4);//Plot(Sell==4,"ApplyStop 
Sell",colorRed,1|styleOwnScale);//Plot(Cover==4,"ApplyStop 
Cover",colorGreen,1|styleOwnScale); rgds, PalSend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.