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

[amibroker] MAcross, EMAcross Prediction [some recent examples]



PureBytes Links

Trading Reference Links




Four consecutive days the Interpretation window 
reading for ^VLIC was "Expect a bearish MAcross soon"
The "Expect a bearish MAcross tomorrow" did not 
appear.
Some other time, not now.
Some "back to the top" attempt was 
better.
The same period, the contrarian ^VIX was warning 
"Expect a bullish MAcross soon".
But, he didn´t.
Better to go lower now and try later.
For the indicator builder/interpretation window the 
code was 
 <FONT color=#ffffe0 
size=2>
// MA cross Prediction 

p=20;MAp=<FONT 
size=2>MA(C,p);<FONT 
face=Arial>
k=30;MAk=<FONT 
size=2>MA(C,k);<FONT 
face=Arial>
tClose=(p*(k-1)*<FONT 
size=2>MA(C,k-1<FONT 
size=2>)-k*(p-1)*<FONT 
size=2>MA(C,p-1<FONT 
size=2>))/(k-p);
DescCrossPrediction=Cross<FONT 
size=2>(tClose,C);
AscCrossPrediction=Cross<FONT 
size=2>(C,tClose);
ExpectMAcross=DescCrossPrediction OR 
AscCrossPrediction;
Confirmed=Cross(MAk,MAp) OR 
Cross<FONT 
face=Arial>(MAp,MAk);
UR=2*<FONT 
size=2>Highest(ROC<FONT 
size=2>(C,1));LR=<FONT 
size=2>2*Lowest<FONT 
size=2>(ROC(C,<FONT 
size=2>1));<FONT 
face=Arial>
Ucoeff=1+UR/<FONT 
size=2>100;Lcoeff=1<FONT 
size=2>+LR/100<FONT 
face=Arial>;
Filter=tClose<Lcoeff*C OR 
tClose>Ucoeff*C;
AddColumn(MAp,"MAp"<FONT 
size=2>);
AddColumn(MAk,"MAk"<FONT 
size=2>);
Plot(C,""<FONT 
size=2>,7*Filter+<FONT 
size=2>1,64<FONT 
size=2>);
Plot(MAp,""<FONT 
size=2>,4,<FONT 
size=2>1);Plot<FONT 
size=2>(MAk,"",<FONT 
size=2>5,1<FONT 
size=2>);
bars=<FONT 
size=2>BarsSince(Cross<FONT 
size=2>(MAp,MAk) OR Cross<FONT 
size=2>(MAk,MAp));
expect=NOT(Filter);
Title=Name()+" 
, "+
WriteIf(expect AND NOT(expectMAcross) AND 
NOT(Confirmed) AND bars>3 AND 
tClose<C,"EXPECT a bearish MAcross SOON"<FONT 
size=2>,"")+<FONT 
size=2>
WriteIf(expect AND NOT(expectMAcross) AND 
NOT(Confirmed) AND bars>3 AND 
tClose>C,"EXPECT a bullish MAcross SOON"<FONT 
size=2>,"")+<FONT 
size=2>
WriteIf(DescCrossPrediction,"EXPECT 
a bearish MAcross TOMORROW",<FONT 
size=2>"")+<FONT 
face=Arial>
WriteIf(AscCrossPrediction,"EXPECT 
a bullish MAcross TOMORROW",<FONT 
size=2>"")+<FONT 
face=Arial>
WriteIf(Cross<FONT 
size=2>(MAp,MAk)," , Bullish MAcross"<FONT 
size=2>,"")+<FONT 
size=2>WriteIf(Cross<FONT 
size=2>(MAk,MAp)," , Bearish MAcross"<FONT 
size=2>,"");
 
The same story was described by the Prediction 
curves graph.
The [black] MAcrossClose attempted to cross the 
[green] actual ^VLIC Close line, but the last moment change its 
direction.
The [red] EMAcrossClose was watching from a 
distance, without any specific intention to cross the actual Close.
For ^VIX the graph was more dramatic. The black line was 
ready to cross the green and change direction the last two days.
The message was clear from both sides : Let´s go 
back to the top for a while and leave the bearish mood for another [better] 
opportunity.
Dimitris Tsokakis
 
----- Original Message ----- 
From: <A 
href="" title=tsokakis@xxxxxxxxx>Dimitris Tsokakis 

To: <A href="" 
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx 
Sent: Wednesday, July 23, 2003 10:38 AM
Subject: MAcross, EMAcross Prediction [a qualitative 
description]

As explained at
<FONT 
color=#000000 face=Arial 
size=2>http://groups.yahoo.com/group/amibroker/message/44790
the next bar Close necessary for an MAk, MAp cross 
is
 
 
MAcrossClose=(p*(k-1)*<FONT 
size=2>MA(C,k-1<FONT 
size=2>)-k*(p-1)*<FONT 
size=2>MA(C,p-1<FONT 
size=2>))/(k-p);
With similar math procedure we may calculate the 
next bar Close necessary for an EMAk, EMAp cross
 <FONT 
face=Arial>
EMAcrossClose=((p+1)*(k-<FONT 
size=2>1)*EMAk-(k+1<FONT 
size=2>)*(p-1)*EMAp)/(<FONT 
size=2>2*(k-p));
Let us see a qualitative comparison:
The green line is the actual Close, the red is the 
EMAcrossClose and the black is the MAcrossClose.
We may see some periods with absurd high [or low] 
values. The trend is very strong, a probable cross
which would signal the change of the trend is not 
visible in the near future.
The highest [lowest] prediction curves point gives 
the turning point of the market.
[H1, L1 for the MAcrossClose and H2, L2 for the 
EMAcrossClose ]
A descending cross confirms the bullish 
trend.[point X]
An ascending cross confirms the bearish trend. 
[point Y]
When both red/black lines are descending, we have a 
mutual confirmation of the trend.
[covariant lines area]
When they have opposite directions, the phase is 
ambiguous and it is better to wait for more clear signals.
[contravariant lines area]
 
For your own further analysis, paste in your 
indicator builder the code
 
// MAcross, EMAcross Prediction 
curves, by Dimitris Tsokakis, July 2003
Plot(C,<FONT 
size=2>"Close",5<FONT 
size=2>,8);<FONT 
face=Arial>
K=30;EMAk=<FONT 
size=2>EMA(C,k);// 
Plot(EMAk,"EMAk",1,8);
p=20;EMAp=<FONT 
size=2>EMA(C,p);// 
Plot(EMAp,"EMAp",2,8);
EMAcrossClose=((p+1)*(k-<FONT 
size=2>1)*EMAk-(k+1<FONT 
size=2>)*(p-1)*EMAp)/(<FONT 
size=2>2*(k-p));
Plot(EMAcrossClose,<FONT 
size=2>"EMAcrossClose",4<FONT 
size=2>,8);<FONT 
face=Arial>
MAcrossClose=(p*(k-1)*<FONT 
size=2>MA(C,k-1<FONT 
size=2>)-k*(p-1)*<FONT 
size=2>MA(C,p-1<FONT 
size=2>))/(k-p);
Plot(MAcrossClose,<FONT 
size=2>"MAcrossClose",1<FONT 
size=2>,8);<FONT 
face=Arial>
GraphXSpace=5;
 
For some periods the description of the stock behavior may 
be quite reliable.
Enjoy !!
Dimitris Tsokakis






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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.



Attachment:
examples.gif

Attachment: Description: "Description: GIF image"