MRO function implementation

arikhard

Newbie
Messages
2
Likes
0
Hello,

I am developing trading program using C# (I don't have Tradestation). I have some TS code that I should convert to C#. The TS source code I have uses MRO-function (it is used like this Bull = MRO (condition3, 15,1)). The problem is that I have not found the description of the MRO function so I don't know what that function do. Is there any place where I can find the documentation about that function or even source code (any language do) ?
 
arikhard said:
Hello,

I am developing trading program using C# (I don't have Tradestation). I have some TS code that I should convert to C#. The TS source code I have uses MRO-function (it is used like this Bull = MRO (condition3, 15,1)). The problem is that I have not found the description of the MRO function so I don't know what that function do. Is there any place where I can find the documentation about that function or even source code (any language do) ?

Here is mine (from Ts2000i), hope it helps.
Steve


{*******************************************************************
Description: Most Recent Occurrence
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Expression(TrueFalseSeries), Length(NumericSimple), Occur(NumericSimple);
Variables: TrueCount(0), Counter(0);

Counter = 0;
TrueCount = 0;

While Counter < Length AND TrueCount < Occur Begin
If Expression[Counter] Then
TrueCount = TrueCount + 1;
Counter = Counter + 1;
End;
If TrueCount >= Occur AND TrueCount > 0 Then
MRO = Counter - 1 + CurrentBar - BarNumber
Else
MRO = -1;
 
riddle said:
Here is mine (from Ts2000i), hope it helps.
Steve


{*******************************************************************
Description: Most Recent Occurrence
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Expression(TrueFalseSeries), Length(NumericSimple), Occur(NumericSimple);
Variables: TrueCount(0), Counter(0);

Counter = 0;
TrueCount = 0;

While Counter < Length AND TrueCount < Occur Begin
If Expression[Counter] Then
TrueCount = TrueCount + 1;
Counter = Counter + 1;
End;
If TrueCount >= Occur AND TrueCount > 0 Then
MRO = Counter - 1 + CurrentBar - BarNumber
Else
MRO = -1;


Thank you very much, this solves my problem.
 
Top