Vars
NumericSeries A;
Begin
A=OpenD(0)+(CloseD(1)-CloseD(2))*Sin(BarsSinceToday);
If(C[1]>A[1] && H>H[1]) Buy(1,Max(H[1],O));
If(C[1]<A[1] && L<L[1]) SellShort(1,Min(L[1],O));
End