Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

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 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
Bruce_L
Posted : Friday, June 15, 2018 2:12:28 PM


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

You're welcome.



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

Forum Jump
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.