Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

minutes on a day formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
0002ct
Posted : Friday, March 15, 2019 10:05:41 AM
Registered User
Joined: 11/19/2015
Posts: 459

Hello.

How can I output a bars-ago count in minutes for this red-to-green indicator:
 

XAVG((XAVG(STOC10, 5) - MIN(XAVG(STOC10, 5), 10)) / (MAX(XAVG(STOC10, 5), 10) - MIN(XAVG(STOC10, 5), 10)), 5) > XAVG((XAVG(STOC10.1.1, 5) - MIN(XAVG(STOC10.1.1, 5), 10)) / (MAX(XAVG(STOC10.1.1, 5), 10) - MIN(XAVG(STOC10.1.1, 5), 10)), 5) AND XAVG((XAVG(STOC10.1.1, 5) - MIN(XAVG(STOC10.1.1, 5), 10)) / (MAX(XAVG(STOC10.1.1, 5), 10) - MIN(XAVG(STOC10.1.1, 5), 10)), 5) <= XAVG((XAVG(STOC10.1.2, 5) - MIN(XAVG(STOC10.1.2, 5), 10)) / (MAX(XAVG(STOC10.1.2, 5), 10) - MIN(XAVG(STOC10.1.2, 5), 10)), 5)


I'd like to know "how many minutes (bars) ago" the above state change occured. I would end up using these in tables to sort these events by recency.

Thank you very much for taking a look.
Bruce_L
Posted : Friday, March 15, 2019 11:24:55 AM


Worden Trainer

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

Maybe put the entire thing in a SinceTrue() function in a 1-minute indicator formula?

SinceTrue(XAVG((XAVG(STOC10, 5) - MIN(XAVG(STOC10, 5), 10)) / (MAX(XAVG(STOC10, 5), 10) - MIN(XAVG(STOC10, 5), 10)), 5) > XAVG((XAVG(STOC10.1.1, 5) - MIN(XAVG(STOC10.1.1, 5), 10)) / (MAX(XAVG(STOC10.1.1, 5), 10) - MIN(XAVG(STOC10.1.1, 5), 10)), 5) AND XAVG((XAVG(STOC10.1.1, 5) - MIN(XAVG(STOC10.1.1, 5), 10)) / (MAX(XAVG(STOC10.1.1, 5), 10) - MIN(XAVG(STOC10.1.1, 5), 10)), 5) <= XAVG((XAVG(STOC10.1.2, 5) - MIN(XAVG(STOC10.1.2, 5), 10)) / (MAX(XAVG(STOC10.1.2, 5), 10) - MIN(XAVG(STOC10.1.2, 5), 10)), 5), 390)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
0002ct
Posted : Friday, March 15, 2019 11:26:07 AM
Registered User
Joined: 11/19/2015
Posts: 459

To clarify, I use the formula above typically on Daily timeframes. However, I would like to calcuate in minutes (or some shorter timeframe) the bars elapsed since the signal. Thank you.

0002ct
Posted : Friday, March 15, 2019 11:32:54 AM
Registered User
Joined: 11/19/2015
Posts: 459

Our posts crossed each other. I think the solution is what I need. Thanks so much, Bruce. Hope all's well.

Bruce_L
Posted : Friday, March 15, 2019 11:49:52 AM


Worden Trainer

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

That is going to be the formula calculated in a 1-minute time frame and the bars since it was true in a 1-minute time frame.

There really isn't a way to mix time frames to check for how many minutes ago the formula started being true or was most recently true in a daily time frame.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
0002ct
Posted : Friday, March 15, 2019 11:54:08 AM
Registered User
Joined: 11/19/2015
Posts: 459

Yes, understood. The solution works for what I need. Thank you.

Bruce_L
Posted : Friday, March 15, 2019 11:55:50 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.