Typ : Function, Name : CriteriaCounter
Inputs: Criteria(TrueFalse), Length(Numeric);
Vars: Accum(0);
For value1 = 0 To Length-1 Begin
IF Criteria[value1] Then
Accum = Accum + 1;
End;
IF Accum <> 0 Then Begin
CriteriaCounter = Accum;
Accum = 0;
End;
Typ : System, Name : TrueContrarian
Inputs: Criteria(C Cross Over Average(C, 10) Or C Cross Under Average(C, 10)), Length(40);
If CriteriaCounter(Criteria, Length) > 10 Then Begin
If C Cross Over Average(C, 10) Then
Buy Tomorrow at Open;
If C Cross Under Average(C, 10) Then
Sell Tomorrow at Open;
End;
If C Cross Under Average(C, 10) Then
ExitLong Tomorrow at Open;
If C Cross Over Average(C, 10) Then
ExitShort Tomorrow at Open;