Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/5/2015 Posts: 107
|
Please help me set the following condition within a scan:
Exp Moving Average 50 of price history above Exp Mov Avg 100 of price history every day during the last X number of days.
I thought this is straight foward by using True within the last X bars in the Edit Condition window, but I get results that do not verify the condition.
Thank you,
Corto
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Try using the new PCF syntax in version 17:
TrueInRow(XAVGC50 > XAVGC100,50) = 50
Just set 50 and = 50 to X number of days.
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
I tried setting a new Condition (PCF) Formula and entered your formula but i keeps asking me to enter a formula. I'm doing something wrong. Please help.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try copying and pasting the formula into a text editor (such a Notepad and not a word processor like Word). Then copy and paste from the text editor into TC2000 instead of copying and pasting directly from the forums.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
This was the trick. Thank you!
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
I seached and found where this TrueInRow syntax is explained and I realized what I wanted was my condition to be true for at least X number o days. In this case I can't figure out the formula. Please help again.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
See the two 50s near the end of the formula in bold? Change those to different numbers to change X to something besides 50.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
So you mean the following will bring results where the condition was true for the past 75 days or more than 75 days in the past?
TrueInRow(XAVGC50 > XAVGC100,75) = 75
I tend to think instead of the = sign, I would need > , something like:
TrueInRow(XAVGC50 > XAVGC100,75) > 75
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You want the first first formula.
TrueInRow(XAVGC50 > XAVGC100,75) = 75
The second formula would never return true because TrueInRow(XAVGC50 > XAVGC100, 75) returns an interegr between 0 and 75. So it can't be greater than 75.
TrueInRow(XAVGC50 > XAVGC100, 75) checks the most recent 75 bars and returns how many bars in a row this was true starting with the current bar. So if the current bar isn't true it will return 0. If the most recent 10 bars (including the current bar) are true but the 11th bar is not, then it would return 10.
So if you wanted to check for exactly 75 bars in a row, you would use the following.
TrueInRow(XAVGC50 > XAVGC100, 76) = 75
Because this would return an integer between 0 and 76 and if more than 75 bars in a row were true, then the formula would be false and if less that 75 bars in a row were true the formulas would also be false.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
Still confused.
I need the condition satisfied for 75 or more days in a row in the past.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You want the first first formula from your Friday, January 19, 2018 12:29:54 PM ET post.
TrueInRow(XAVGC50 > XAVGC100,75) = 75
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
Will this also bring the stock that satisfied the condition for the past 100 consecutice days?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Yes, it will. The formula has no idea what happened on bars 26 through 100. It is only checking for what happened during bars 1 through 75 (with 1 being current bar).
So as long as it was true 75 bars in a row, it doesn't matter if it was true exactly 75 bars in a row or 200 bars in a row, it will still return true.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2015 Posts: 107
|
Finally got it. Thanks a lot and sorry for all the hassle.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |