Platinum Customer
Joined: 1/30/2005 Posts: 135
|
Is it possible to translate the following RealCode to a V18 PCF?
Static Buy As Single
If isFirstBar Then
Buy = 0
End If
If buy = 0 AndAlso price.high >= price.MaxClose(20, 1) AndAlso price.stoc(21, 8) < 69 Then
buy = 1
plot = 1
Else If buy = 1 AndAlso price.STOC(21, 8) <= price.stochastics(21, 8).avg(5) _
AndAlso price.STOC(21, 8, 1) > price.stochastics(21, 8).avg(5, 1) _
AndAlso price.STOC(21, 8, 1) >= 33 Then
buy = 0
plot = -1
Else plot = 0
End If
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
We can't create an exact duplicate because we can't really build a state machine. You may want to try the following however.
IIF(H >= MAXC20.1 AND STOC21.8 < 69 AND TrueInRow(NOT(H1 >= MAXC20.2 AND STOC21.9 < 69), 100) > TrueInRow(NOT(STOC21.8.1 <= AVG(STOC21.8.1, 5) AND STOC21.8.2 > AVG(STOC21.8.2, 5) AND STOC21.8.2 >= 33), 100), 1, IIF(STOC21.8 <= AVG(STOC21.8, 5) AND STOC21.8.1 > AVG(STOC21.8.1, 5) AND STOC21.8.1 >= 33 AND TrueInRow(NOT(H1 >= MAXC20.2 AND STOC21.9 < 69), 100) < TrueInRow(NOT(STOC21.8.1 <= AVG(STOC21.8.1, 5) AND STOC21.8.2 > AVG(STOC21.8.2, 5) AND STOC21.8.2 >= 33), 100), -1, 0))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Platinum Customer
Joined: 1/30/2005 Posts: 135
|
Works well. Thanks for your help.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|