PureBytes Links
Trading Reference Links
|
Wow, I was catching up a bit during the weekend, stumbled on wabbit's
initial modifications, and, after having thought you could speed up
the original, posted my own variation. Then I noted the replies to it
and now I feel as if I've walked straight into a trap! Anyhow, see my
post as an illustration of how one could extend the system and modify
the code when taking it outside of MSFL to speed it up in preparation
for use with say an optimiser or Monte Carlo simulator.
Anyhow, I am glad to hear that magazine found it works well. Note
that there are many combinations, such as if the 10 day MA is above
the 20 day MA, the 30 day MA and so on. Then if the 20 day MA is
above the 30 day MA, the 40 day MA and so on. What we do with one
neural net, is to calculate something like the following inputs
Input 1 = C / 10 day MA - 1
Input 2 = C / 20 day MA - 1
Input 3 = 10 day / 20 day MA - 1
etc.
In the end, the close is compared to all moving averages and all
moving averages are compared to one another. We feed this to the net
that then tries to extract any historical patterns and voila! you have
a trading model! I have no idea how this would perform on its own, as
it forms part of a larger model, but it is encouraging if this type of
indicator was found useful by others.
Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com
--- In equismetastock@xxxxxxxxxxxxxxx, mgf_za_1999 <no_reply@xxxx> wrote:
> Now, if you want to build a model using this indicator, you don't want
> to calculate all those moving averages, as it will make any
> optimisation process very slow. MSFL is slow by default, so you want
> to speed up things anyhow, even if you are not optimising. So you
> calculate just one indicator, the cumulative sum of the closes, and
> use only that.
>
> You also want to test how many of these steps you should perform.
> Should you use 5, 10, 15 or whatever. Also, you rebase the indicator
> to somewhere between -1 and +1, so that it remains the same for all
> combinations. You also rewrite it a bit so that divisions, which take
> longer to do, become multiplications, and the new 'thing' becomes
>
> ----8<------------------
>
> {Trend Strength Indicator}
> {for metastock, coded by P Umrysh}
> {from the August 2005 issue of Active Trader Magazine}
> {modified by wabbit 08Jul05}
> {modified by MG Ferreira 09 Jul 05}
>
> PRD := INPUT("Enter periods",1,100,10);
> STEP := INPUT("Enter step size",1,50,10);
> NSTEP := INPUT("Enter number of steps",1,20,10);
>
> XX := Cum(C);
>
> SS :=
> (C*PRD > (XX-Ref(XX,-PRD ))) +
> (C*(PRD+ STEP) > (XX-Ref(XX,-PRD- STEP))) * (NSTEP> 1) +
> (C*(PRD+ 2*STEP) > (XX-Ref(XX,-PRD- 2*STEP))) * (NSTEP> 2) +
> (C*(PRD+ 3*STEP) > (XX-Ref(XX,-PRD- 3*STEP))) * (NSTEP> 3) +
> (C*(PRD+ 4*STEP) > (XX-Ref(XX,-PRD- 4*STEP))) * (NSTEP> 4) +
> (C*(PRD+ 5*STEP) > (XX-Ref(XX,-PRD- 5*STEP))) * (NSTEP> 5) +
> (C*(PRD+ 6*STEP) > (XX-Ref(XX,-PRD- 6*STEP))) * (NSTEP> 6) +
> (C*(PRD+ 7*STEP) > (XX-Ref(XX,-PRD- 7*STEP))) * (NSTEP> 7) +
> (C*(PRD+ 8*STEP) > (XX-Ref(XX,-PRD- 8*STEP))) * (NSTEP> 8) +
> (C*(PRD+ 9*STEP) > (XX-Ref(XX,-PRD- 9*STEP))) * (NSTEP> 9) +
> (C*(PRD+10*STEP) > (XX-Ref(XX,-PRD-10*STEP))) * (NSTEP>10) +
> (C*(PRD+11*STEP) > (XX-Ref(XX,-PRD-11*STEP))) * (NSTEP>11) +
> (C*(PRD+12*STEP) > (XX-Ref(XX,-PRD-12*STEP))) * (NSTEP>12) +
> (C*(PRD+13*STEP) > (XX-Ref(XX,-PRD-13*STEP))) * (NSTEP>13) +
> (C*(PRD+14*STEP) > (XX-Ref(XX,-PRD-14*STEP))) * (NSTEP>14) +
> (C*(PRD+15*STEP) > (XX-Ref(XX,-PRD-15*STEP))) * (NSTEP>15) +
> (C*(PRD+16*STEP) > (XX-Ref(XX,-PRD-16*STEP))) * (NSTEP>16) +
> (C*(PRD+17*STEP) > (XX-Ref(XX,-PRD-17*STEP))) * (NSTEP>17) +
> (C*(PRD+18*STEP) > (XX-Ref(XX,-PRD-18*STEP))) * (NSTEP>18) +
> (C*(PRD+19*STEP) > (XX-Ref(XX,-PRD-19*STEP))) * (NSTEP>19);
>
> ( 2*SS - NSTEP ) / NSTEP
>
> ----8<------------------
>
>
> Now, this looks bad but is easily done using any programming language
> where loops are allowed. All those lines that form part of the sum SS
> are done inside this loop as a fairly simple addition. The loop ends
> at the right spot, so that the multipliation with NSTEP > xx falls away.
>
> I also am not sure about MSFL, but this function is supposed to be
> very fast. In a normal programming language, at each step, you just
> update xx as XX = XX + C. XX starts at 0. MSFL does not allow this,
> so the one difference between this function and the original is that
> it starts one observation later than the original. Again, in a real
> programming language, this would not be the case.
>
> Now, if only super can endorse the trading qualities of this new
> indicator I can sell it to the world and retire early.....
>
> Regards
> MG Ferreira
> TsaTsa EOD Programmer and trading model builder
> http://www.ferra4models.com
> http://fun.ferra4models.com
>
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "bellamy_29m"
> <bellamy_29m@xxxx> wrote:
> > Similar results (0-10) instead of -100 to 100 with simpler code:
> >
> > {Trend Strength Indicator}
> > {for metastock, coded by P Umrysh}
> > {from the August 2005 issue of Active Trader Magazine}
> > {modified by wabbit 08Jul05}
> >
> > PRD:= Input("ENTER PERIODS FOR SMA",1,100,10);
> > STEP:= Input("ENTER SMA STEPS",1,50,10);
> >
> > (C>Mov(C,PRD+(STEP*0),S))+
> > (C>Mov(C,PRD+(STEP*1),S))+
> > (C>Mov(C,PRD+(STEP*2),S))+
> > (C>Mov(C,PRD+(STEP*3),S))+
> > (C>Mov(C,PRD+(STEP*4),S))+
> > (C>Mov(C,PRD+(STEP*5),S))+
> > (C>Mov(C,PRD+(STEP*6),S))+
> > (C>Mov(C,PRD+(STEP*7),S))+
> > (C>Mov(C,PRD+(STEP*8),S))+
> > (C>Mov(C,PRD+(STEP*9),S))
> >
> > Hpe this helps.
> >
> > wabbit :D
> >
> > <snip>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|