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 |

How do I conver this in TC2000? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
options101
Posted : Wednesday, March 29, 2017 7:50:54 PM
Platinum Customer Platinum Customer

Joined: 1/25/2005
Posts: 11

input stDevLength = 6;

input averageLength = 2;

input averageType = AverageType.EXPONENTIAL;

 

def stDevHi = StDev(high, stDevLength);

def stDevLo = StDev(low, stDevLength);

 

def avgStDevHiUp = MovingAverage(averageType, if high > high[1] then stDevHi else 0, averageLength);

def avgStDevHiDown = MovingAverage(averageType, if high < high[1] then stDevHi else 0, averageLength);

 

def avgStDevLoUp = MovingAverage(averageType, if low > low[1] then stDevLo else 0, averageLength);

def avgStDevLoDown = MovingAverage(averageType, if low < low[1] then stDevLo else 0, averageLength);

 

def rviHi = if avgStDevHiUp + avgStDevHiDown == 0 then 50 else 100 * avgStDevHiUp / (avgStDevHiUp + avgStDevHiDown);

def rviLo = if avgStDevLoUp + avgStDevLoDown == 0 then 50 else 100 * avgStDevLoUp / (avgStDevLoUp + avgStDevLoDown);

 

plot RVI = (rviHi + rviLo) / 2;

plot OverBought = 80;

plot OverSold = 20;

 

 

Bruce_L
Posted : Thursday, March 30, 2017 8:57:22 AM


Worden Trainer

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

Please try the following Indicator Formula in TC2000 v17.

(IIF(XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(H < H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) = 0, 50, 100 * XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) / (XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(H < H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2))) + IIF(XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(L < L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) = 0, 50, 100 * XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) / (XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(L < L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2)))) / 2

You can use it as the Formula in a Custom PCF Indicator if you want to plot it as an indicator on the chart.

If you do so, you may also want to change the Scaling... | Scale Method to 0 to 100 and add Horizontal Lines at 20 and 80.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
options101
Posted : Thursday, March 30, 2017 3:32:21 PM
Platinum Customer Platinum Customer

Joined: 1/25/2005
Posts: 11

Thanks Bruce,

Venkat

options101
Posted : Thursday, March 30, 2017 4:09:13 PM
Platinum Customer Platinum Customer

Joined: 1/25/2005
Posts: 11

Bruce,

 

Looks like there is syntax error. I could not figure it out. 

Venkat

Bruce_L
Posted : Thursday, March 30, 2017 4:21:55 PM


Worden Trainer

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

The formula is for TC2000 v17. A similar formula for older versions of TC2000 is too long and slow to be practical or post in the forums.

This means that if you are using a Mac, you would probably need to use emulation or virtualization software of some sort which would allow you to run Windows programs on a Mac so you can run TC2000 v17.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
options101
Posted : Thursday, August 24, 2017 3:49:43 PM
Platinum Customer Platinum Customer

Joined: 1/25/2005
Posts: 11

How can I use scaling along with this script?

Thanks Venkat

 

QUOTE (Bruce_L)

Please try the following Indicator Formula in TC2000 v17.

(IIF(XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(H < H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) = 0, 50, 100 * XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) / (XAVG(IIF(H > H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(H < H1, SQR(ABS((SUM(H, 6) - SUM(H, 6) ^ 2 / 6) / 6)), 0), 2))) + IIF(XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(L < L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) = 0, 50, 100 * XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) / (XAVG(IIF(L > L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2) + XAVG(IIF(L < L1, SQR(ABS((SUM(L, 6) - SUM(L, 6) ^ 2 / 6) / 6)), 0), 2)))) / 2

You can use it as the Formula in a Custom PCF Indicator if you want to plot it as an indicator on the chart.

If you do so, you may also want to change the Scaling... | Scale Method to 0 to 100 and add Horizontal Lines at 20 and 80.

Bruce_L
Posted : Thursday, August 24, 2017 4:02:51 PM


Worden Trainer

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

Click on the name of the Custom PCF Indicator at the top of the pane in which it is plotted and select Scaling and change the Scale method to 0 to 100.

Click on the name of the Custom PCF Indicator at the top of the pane in which it is plotted and select Horizontal Lines... | Add Line. Then repeat the process to add a second line.

Change At Value to 20.00 for one of the lines and 80.00 for the other line.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
options101
Posted : Friday, August 25, 2017 3:31:37 PM
Platinum Customer Platinum Customer

Joined: 1/25/2005
Posts: 11

Thanks Bruce

QUOTE (Bruce_L)

Click on the name of the Custom PCF Indicator at the top of the pane in which it is plotted and select Scaling and change the Scale method to 0 to 100.

Click on the name of the Custom PCF Indicator at the top of the pane in which it is plotted and select Horizontal Lines... | Add Line. Then repeat the process to add a second line.

Change At Value to 20.00 for one of the lines and 80.00 for the other line.

Bruce_L
Posted : Friday, August 25, 2017 3:54:43 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.