PureBytes Links
Trading Reference Links
|
AVST=MA(StochD(X1),100);
Let us try now to buy lower and sell higher.
The buy level will be AVST-Dbuy and the sell level will
be AVST+Dsell. If you guess now, optimization may give
the best values for the 3 parameters.
Optimize a current stock for all quotations using the code
/*Buy-Sell moving levels for Slow Stochastic*/
Dbuy=Optimize("Dbuy",14,0,20,1);
Dsell=Optimize("Dsell",8,0,20,1);
X1=Optimize("X1",13,10,20,1);
s1=StochD(X1);
AVST=MA(s1,100);
Buy = Cross( s1,AVST-DBuy);
Sell = Cross( AVST+Dsell,s1);
Then replace manually the 14, 8, 13 with respective results of your
optimization and scan and back test.
Compare the back test result with the traditional
buy=cross(stochd(),30);
sell=cross(70,stochd());
scan and back test.
I found interesting net profit augmentation.
As for settings, I used buy at low, sell at high with delay 1 day
(it is obvious that you get the signal today and you act tomorrow
and it is always important for back testing. Delay 0 is meaningless,
the signal is first and then the action may be done.)
After the calculation of above parameters, you may see in your
Indicator builder the new curves, pasting the formula:
/*Slow Stochastic moving buy-sell levels*/
Dbuy=14;
Dsell=8;
X1=13;
MaxGraph=12;
ST3=StochK(X1);
ST33=StochD(X1);
Graph0=ST3;
Graph1=ST33;
AVST=MA(StochD(X1),100);
Graph9=AVST-Dbuy;Graph10=AVST+Dsell;
Graph8=avst;Graph8Style=8;Graph8BarColor=2;
Graph9Style=Graph10Style=8;
Graph9BarColor=Graph10BarColor=1;
and replace 14, 8, 13 with the results of optimization.
Real examples will follow.
Dimitris Tsokakis
------=_NextPart_001_002A_01C14BFE.54AD3B60
Content-Type: text/html;
charset="iso-8859-7"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-7" http-equiv=Content-Type>
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Instead of MEANST it is more flexible to use a
moving average </FONT></DIV>
<DIV><FONT face=Arial size=2>of slow stochastic. Various test indicate that 100
days average </FONT></DIV>
<DIV><FONT face=Arial size=2>is satisfactory in general.</FONT></DIV>
<DIV><FONT face=Arial size=2>So, the new medium line for stochd() is not the
steady and arbitrary</FONT></DIV>
<DIV><FONT face=Arial size=2>50, but the closer to reality </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV><FONT size=2><FONT face=Arial>
<DIV>AVST=<B>MA</B>(StochD(X1),100);</FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Let us try now to buy lower and sell
higher.</FONT></DIV>
<DIV><FONT face=Arial size=2>The buy level will be AVST-Dbuy and the sell level
will</FONT></DIV>
<DIV><FONT face=Arial size=2>be AVST+Dsell. If you guess now, optimization may
give</FONT></DIV>
<DIV><FONT face=Arial size=2>the best values for the 3 parameters.</FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG><FONT color=#ff0000>Optimize
</FONT></STRONG>a <FONT color=#ff0000><STRONG>current stock </STRONG></FONT>for
<FONT color=#ff0000><STRONG>all quotations </STRONG></FONT>using the
code</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><FONT face=Arial>/*<STRONG><FONT color=#0000ff>Buy-Sell moving
levels for Slow Stochastic</FONT></STRONG>*/</FONT></DIV><FONT face=Arial>
<DIV>Dbuy=</FONT><B><FONT size=2>Optimize</B></FONT></FONT><FONT
face=Arial><FONT size=2>(</FONT><FONT size=2>"Dbuy"</FONT><FONT
size=2>,</FONT><FONT color=#0000ff size=2><STRONG>14</STRONG></FONT><FONT
size=2>,</FONT><FONT size=2>0</FONT><FONT size=2>,</FONT><FONT
size=2>20</FONT><FONT size=2>,</FONT><FONT size=2>1</FONT></FONT><FONT
face=Verdana size=2><FONT face=Arial>);</FONT></DIV><FONT face=Arial>
<DIV>Dsell=</FONT><B><FONT size=2>Optimize</B></FONT></FONT><FONT
face=Arial><FONT size=2>(</FONT><FONT size=2>"Dsell"</FONT><FONT
size=2>,</FONT><FONT color=#0000ff><STRONG><FONT size=2>8</FONT><FONT
size=2>,</FONT></STRONG></FONT><FONT size=2>0</FONT><FONT size=2>,</FONT><FONT
size=2>20</FONT><FONT size=2>,</FONT><FONT size=2>1</FONT></FONT><FONT
face=Verdana size=2><FONT face=Arial>);</FONT></DIV><FONT face=Arial>
<DIV>X1=</FONT><B><FONT size=2>Optimize</B></FONT></FONT><FONT face=Arial><FONT
size=2>(</FONT><FONT size=2>"X1"</FONT><FONT size=2>,</FONT><FONT color=#0000ff
size=2><STRONG>13</STRONG></FONT><FONT size=2>,</FONT><FONT
size=2>10</FONT><FONT size=2>,</FONT><FONT size=2>20</FONT><FONT
size=2>,</FONT><FONT size=2>1</FONT></FONT><FONT face=Verdana size=2><FONT
face=Arial>);</FONT></DIV><FONT face=Arial>
<DIV>s1=</FONT><B><FONT size=2>StochD</B></FONT></FONT><FONT face=Verdana
size=2><FONT face=Arial>(X1);</FONT></DIV><FONT face=Arial>
<DIV>AVST=</FONT><B><FONT size=2>MA</B></FONT></FONT><FONT face=Arial><FONT
size=2>(s1,</FONT><FONT size=2>100</FONT></FONT><FONT face=Verdana size=2><FONT
face=Arial>);</FONT></DIV><FONT face=Arial>
<DIV>Buy = </FONT><FONT size=2><STRONG>Cross</STRONG></FONT><FONT size=2>(
s1,AVST-DBuy);</FONT></FONT></DIV><FONT face=Arial>
<DIV><FONT size=2><B>Sell</B> = <B>Cross</B><FONT
face=Verdana></FONT></FONT><FONT face=Arial size=2>(
AVST+Dsell,s1);</FONT></FONT></DIV>
<DIV><FONT face=Verdana></FONT> </DIV>
<DIV><FONT face=Verdana><FONT face=Arial size=2>Then replace manuallythe 14, 8,
13 with respective results of your</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT face=Arial size=2>optimization and <STRONG><FONT
color=#ff0000>scan </FONT></STRONG>and <FONT color=#ff0000><STRONG>back
test.</STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT face=Arial size=2>Compare the back testresult
with the traditional</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT face=Arial size=2></FONT></FONT> </DIV>
<DIV><FONT face=Verdana><FONT face=Arial
size=2>buy=cross(stochd(),30);</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT face=Arial
size=2>sell=cross(70,stochd());</FONT></FONT></DIV>
<DIV><FONT face=Verdana> </DIV>
<DIV><FONT face=Arial size=2><STRONG><FONT color=#ff0000>scan
</FONT></STRONG>and <FONT color=#ff0000><STRONG>back
test.</STRONG></FONT></FONT></DIV>
<DIV> </DIV>
<DIV></FONT><FONT face=Arial size=2>I found interesting net profit
augmentation.</FONT></DIV>
<DIV><FONT face=Arial size=2>As for settings, I used buy at low, sell at
high with delay 1 day</FONT></DIV>
<DIV><FONT face=Arial size=2>(it is obvious that you get the signal today and
you act tomorrow</FONT></DIV>
<DIV><FONT face=Arial size=2>and it is always important for back testing. Delay
0 is meaningless,</FONT></DIV>
<DIV><FONT face=Arial size=2>the signal is first and then the action may be
done.)</FONT></DIV>
<DIV><FONT face=Arial size=2>After the calculation of above parameters,you may
see in your</FONT></DIV>
<DIV><FONT face=Arial size=2>Indicator builder the new curves, pasting the
formula:</FONT></DIV>
<DIV> <FONT face=Arial size=2></DIV>
<DIV>/*Slow Stochastic moving buy-sell levels*/</DIV>
<DIV></FONT><FONT size=2><FONT face=Arial> </DIV></FONT><FONT
size=2></FONT><FONT face=Arial>
<DIV>Dbuy=</FONT><FONT color=#0000ff size=2><STRONG>14</STRONG></FONT><FONT
size=2></FONT><FONT face=Arial>;</FONT></DIV><FONT face=Arial>
<DIV>Dsell=</FONT><FONT color=#0000ff size=2><STRONG>8</STRONG></FONT><FONT
size=2></FONT><FONT face=Arial>;</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>
<DIV>X1=<FONT color=#0000ff size=2><STRONG>13</STRONG></FONT><FONT
size=2></FONT><FONT face=Arial>;</FONT></DIV></FONT></DIV><FONT face=Arial>
<DIV>MaxGraph=</FONT><FONT size=2>12</FONT><FONT size=2></FONT><FONT
face=Arial>;</FONT></DIV><FONT face=Arial>
<DIV>ST3=</FONT><B><FONT size=2>StochK</B></FONT></FONT><FONT size=2><FONT
face=Arial>(X1);</FONT></DIV><FONT face=Arial>
<DIV>ST33=</FONT><B><FONT size=2>StochD</B></FONT></FONT><FONT size=2><FONT
face=Arial>(X1);</FONT></DIV><FONT face=Arial>
<DIV>Graph0=ST3;</FONT></DIV><FONT face=Arial>
<DIV><STRONG>Graph1</STRONG>=ST33;</FONT></DIV></FONT><FONT size=2><FONT
face=Arial>
<DIV>AVST=</FONT><B><FONT size=2>MA</B></FONT></FONT><FONT face=Arial><FONT
size=2>(</FONT><B><FONT size=2>StochD</B></FONT></FONT><FONT face=Arial><FONT
size=2>(X1),</FONT><FONT size=2>100</FONT><FONT size=2></FONT><FONT
face=Arial>);</FONT></DIV><FONT face=Arial>
<DIV>Graph9=AVST-Dbuy;Graph10=AVST+Dsell;</FONT></DIV><FONT face=Arial>
<DIV><STRONG>Graph8</STRONG>=avst;<B>Graph8Style</B>=</FONT><FONT
size=2>8</FONT><FONT size=2>;<B>Graph8BarColor</B>=</FONT><FONT
size=2>2</FONT><FONT size=2></FONT><FONT face=Arial>;</FONT></DIV><FONT
face=Arial>
<DIV>Graph9Style=Graph10Style=</FONT><FONT size=2>8</FONT><FONT
size=2></FONT><FONT face=Arial>;</FONT></DIV><FONT face=Arial>
<DIV><STRONG>Graph9BarColor</STRONG>=<B>Graph10BarColor</B>=</FONT><FONT
size=2>1</FONT><FONT size=2>;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>and replace 14, 8, 13 with the results of
optimization.</FONT></DIV>
<DIV><FONT size=2>Real examples will follow.</FONT></DIV>
<DIV><FONT size=2>Dimitris Tsokakis </DIV>
<DIV></FONT></FONT> </DIV>
<DIV><FONT face=Verdana size=2> </DIV></FONT></BODY></HTML>
------=_NextPart_001_002A_01C14BFE.54AD3B60--
Attachment:
gif00195.gif
Attachment:
Description: "Description: GIF image"
|