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

Re: Random trade generator?



PureBytes Links

Trading Reference Links





{-------------------------Start-----------------------------------------
 
  type   : userfunction
  name   : RND
  author : L. Vercesi ,1997

  generate a (pseudo)random number (0-1) using a chaotic equation 
  set MaxBarsBak > 30                                              }

Vars: TT(0);
Arrays: Y[30](0);

If CurrentBar=1 Then Begin
 Y[1]=CurrentTime/2400;
 For TT=2 To 30 Begin
  Y[TT]=3.75*Y[TT-1]*(1-Y[TT-1]);
 End;
End;
Y[1]=Y[30];
For TT=2 To 30 Begin
 Y[TT]=3.75*Y[TT-1]*(1-Y[tt-1]);
End;
RND=Y[30];

{------------------------------End----------------------------------------}



{-----------------------------Start----------------------------------

type         : system
name         : RndSys
author       : L. Vercesi, 1997

               generate random entries. Level sets frequency of trading
(.2>Level>.5)
               close and re-open page to obtain different entries
               
}

Inputs: Level(0.3)

If RND>(1-Level) Then Buy At Close;
If RND<Level Then Sell At Close;

{------------------------------End------------------------------------------
-}   




        -Lorenzo Vercesi,  Italy
         ik2hlb@xxxxxxxx