## New version 18 available now

Subscription & data-feed pricing Class schedule

Margin rates Stock & option commissions

 MaXCLose(20) PCF Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
maljester
 Posted : Friday, June 15, 2018 1:04:33 PM
Platinum Customer

Joined: 1/30/2005
Posts: 135

Is it possible to translate the following RealCode to a V18 PCF?

If isFirstBar Then
End If
If  buy = 0 AndAlso price.high >= price.MaxClose(20, 1) AndAlso price.stoc(21, 8) < 69 Then
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
plot = -1
Else plot = 0
End If
Bruce_L
 Posted : Friday, June 15, 2018 2:12:28 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
maljester
 Posted : Friday, June 15, 2018 3:06:30 PM
Platinum Customer

Joined: 1/30/2005
Posts: 135

Works well.  Thanks for your help.

Bruce_L
 Posted : Friday, June 15, 2018 3:07:45 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

 Forum Jump Customer Training & Support - Ask a Trainer - TC2000 version 12/18 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 18 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot delete your posts in this forum. You cannot edit your posts in this forum. You cannot create polls in this forum. You cannot vote in polls in this forum.