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 |

Numeric Output Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
0002ct
Posted : Tuesday, October 17, 2017 10:04:22 AM
Registered User
Joined: 11/19/2015
Posts: 459

Hello.

Is there a way (formula) to output a value for a boolean?

Say I wanted to show a "1" in a column for C > C1 when true. Is there a way to trick v17 into doing something like this? And if so, could it sum multiple values in a single formula where true? E.g.
C > C1 (1) +
C > C1 () +
C > C3 (1) +
__
2

Thank you.


 

0002ct
Posted : Tuesday, October 17, 2017 10:06:19 AM
Registered User
Joined: 11/19/2015
Posts: 459

Sorry, that should read:
C > C1 (1) +
C > C2 () +
C > C3 (1) +
__
2

Bruce_L
Posted : Tuesday, October 17, 2017 10:17:28 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

IIF(C > C1, 1, 0) + IIF(C > C2, 1, 0) + IIF(C > C3, 1, 0)

Or the slightly shorter

-(C > C1) - (C > C2) - (C > C3)

Inline IF and converting conditions to indicators



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
0002ct
Posted : Tuesday, October 17, 2017 10:27:27 AM
Registered User
Joined: 11/19/2015
Posts: 459


Thank you, Bruce. A next step question:

Is it similarly possible to output values for tiered timeframes in one formula?

Say I want to do:

C > XAVGC8 (D)+
C > XAVGC8 (4 HR)+
C > XAVGC8 (2 HR)+
C > XAVGC8 (1 HR)+
C > XAVGC8 (30M)+
C > XAVGC8 (15M)+
C > XAVGC8 (10M)+
C > XAVGC8 (5M)+
C > XAVGC8 (1M)

Bruce_L
Posted : Tuesday, October 17, 2017 10:30:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

No, it is not.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
0002ct
Posted : Tuesday, October 17, 2017 10:30:56 AM
Registered User
Joined: 11/19/2015
Posts: 459

Thank you, Bruce.

Bruce_L
Posted : Tuesday, October 17, 2017 10:42:54 AM


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.