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 |

position in range new Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
stevehchis
Posted : Tuesday, August 11, 2015 11:12:27 PM
Registered User
Joined: 3/7/2010
Posts: 168

STOC2 .....is position in yesterdays rg.   at current price ( adjustable )

so what would it be if i wanted it to be what it was  at the open (adjustable)

if it can't be done (an adjustable)  what would it be to make it "position in yesterdays rg. < 50% "

prefer it to be adjustable ...thx

Bruce_L
Posted : Wednesday, August 12, 2015 10:37:34 AM


Worden Trainer

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

STOC2 is the position of the close or current price within the most recent 2 bars (including the current bar).

A similar Indicator Formula for the open which includes the entire current range of the current bar can be written as follows.

100 * (O - MINL2) / (MAXH2 - MINL2)

If you only want to include what the range was at the start of the current bar, this could be written as follows.

100 * (O - L1 + ABS(O - L1)) / (H1 - L1 + ABS(O - H1) + ABS(O - L1))

That said, if you actually want where the open was relative only to the range of the previous bar, it could be written as follows.

100 * (O - L1) / (H1 - L1)

Note that all of the above formulas can return division by zero errors when the range being used in the denominator is negative.

Checking for the open being less than half of the range of yesterday can be written as follows.

2 * O < H1 + L1

Personal Criteria Formulas
Stochastic
Min Max PCFs



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stevehchis
Posted : Friday, August 14, 2015 8:54:48 PM
Registered User
Joined: 3/7/2010
Posts: 168

you said 

"STOC2 is the position of the close or current price within the most recent 2 bars (including the current bar)."  

 

and i say oh...i thought STOC2 was the position of the close or current price (not including current bar) ...so how do i get (not including current bar)    i tried STOC2.1 but suprisingly thats not it  ....thx  

Bruce_L
Posted : Monday, August 17, 2015 10:23:31 AM


Worden Trainer

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

STOC2.1 is the 1 period simple moving average of STOC2. This ends up being exactly the same thing as STOC2.

STOC2.1.1 would be the position of the close of 1 bar ago within the range of the 2 bars ending 1 bar ago.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stevehchis
Posted : Tuesday, August 18, 2015 9:06:35 AM
Registered User
Joined: 3/7/2010
Posts: 168

well this is not what i want  (after testing it)  what i want is position of the range of yesterdays candle only not (within the most recent 2 bars ) at the close or current price of today...thx again

Bruce_L
Posted : Tuesday, August 18, 2015 9:31:22 AM


Worden Trainer

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

If I am understanding correctly, then you want the following.

STOC1.1.1



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stevehchis
Posted : Tuesday, August 18, 2015 9:25:06 PM
Registered User
Joined: 3/7/2010
Posts: 168

nope that not it either 

let me try another way ...what i want is  position of the close or current price within the range of yesterdays  bar   ( C1)  

 and could you explain what the numbers mean ...like  (example stoc2.1.1 the first number 2 points to the candle  the second number points to the candle it excludes )  so i might be better able to make the next one myself ...(if i get it)   thx 

 

StockGuy
Posted : Tuesday, August 18, 2015 9:56:46 PM

Administration

Joined: 9/30/2004
Posts: 9,187

What values are you expecting to see if the latest price is outside of the range of yesterday's bar?

Bruce_L
Posted : Wednesday, August 19, 2015 9:16:04 AM


Worden Trainer

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

Please try the following Indicator Formula.

100 * (C - L1) / (H1 - L1)

Price and Volume

Full details of what each parameter does in the Personal Criteria Formula Language can be found on the following webpage.

Personal Criteria Formula Syntax

In STOC2.1.1 the 2 is the period of the raw stochastic, the first 1 is the period of a simple moving average of the raw stochastic used to generate the %K and the second 1 is the number of bars ago.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stevehchis
Posted : Sunday, November 22, 2015 2:19:29 PM
Registered User
Joined: 3/7/2010
Posts: 168

ok now never mind all of the above ..but i think i have a way of explaining what i want that is more clear ...ok what i want  position in  5 day range   but the range counts back 5 days starting yesterday  ( 5.1 )  but i want it to tell me what the position in 5.1 range is at todays close or current price  ....i think the problem was that the range in the past has included todays candle as part of the 5 day range and that not what i want . i will show you in a video to help make it clear 

https://youtu.be/zGh-AXCTmbE

https://youtu.be/zGh-AXCTmbE

 

StockGuy
Posted : Sunday, November 22, 2015 9:36:16 PM

Administration

Joined: 9/30/2004
Posts: 9,187

A picture is always worth a thousand words.  Thanks for the video.

Try this....

(C - MINL5.1) / (MAXH5.1 - MINL5.1) * 100

 

 

 

stevehchis
Posted : Wednesday, January 27, 2016 8:57:59 AM
Registered User
Joined: 3/7/2010
Posts: 168

yep thats what i wanted ...but now can you replace the C for  a SMA such as (avgc8)

and get position of avgc8 in 5.1 day range......i tried it numbers are not right ...if this it ot the way to get it then what is the formula for that thank you

Bruce_L
Posted : Wednesday, January 27, 2016 9:56:19 AM


Worden Trainer

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

AVGC8 within its own 5 bar range ending ending 1 bar ago would be as follows.

100 * (AVGC8 - MIN(AVGC8.1,5)) / (MAX(AVGC8.1,5) - MIN(AVGC8.1,5))

AVGC8 within the 5 bar range of prices ending 1 bar ago would be as follows.

100 * (AVGC8 - MINL5.1) / (MAXH5.1 - MINL5.1)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stevehchis
Posted : Saturday, February 6, 2016 2:59:44 PM
Registered User
Joined: 3/7/2010
Posts: 168

hi bruce 

this is todays price in relation to its position in 5.1 day range formula (C - MINL5.1) / (MAXH5.1 - MINL5.1) * 100

so with that said can you get position in two date points  instead of MINL5 - MAXH5 replace the MINL5 and MAXH5 with dates ...if you can't do it that way with that formula is there another way to formulate position in range using two dates

Bruce_L
Posted : Monday, February 8, 2016 10:38:30 AM


Worden Trainer

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

There really isn't a way you do this by specifiying just two dates.

You can specify the last bar in the date range by replacing the bars ago parameter. So for example, you could use the five trading days ending on February 1, 2016 as follows.

(C - MINL5.'02/01/2016') / (MAXH5.'02/01/2016' - MINL5.'02/01/2016') * 100

But there is no way to specify the starting date other than using the current number of bars in the formula.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
MoreAces
Posted : Monday, February 15, 2016 9:48:19 AM
Registered User
Joined: 8/23/2013
Posts: 245

Bruce this is unrelated but very similar, i am using the first formula and its result will sometimes reach 100 and Max out there, but trying to write the formula different and get the same results but cant quite get there.  Here are the 2 formulas, the later is 1 of my attempts to rewrite different but does not produce the same exact results

 

100 * (C-MIN(C,8)) /( MAX(C,8) -MIN(C,8))

 

100 * (C - MINL8) / (MAXH8 - MINL8)

 

Thanks

MoreAces
Posted : Monday, February 15, 2016 10:00:06 AM
Registered User
Joined: 8/23/2013
Posts: 245

I guess is am not getting the difference in MIN(C,8) and MINL8

MoreAces
Posted : Monday, February 15, 2016 4:14:06 PM
Registered User
Joined: 8/23/2013
Posts: 245

OK I HAVE THIS

(100 * (C-MINC8) /( MAXC8 -MINC8) )

That said, this what i want to know if we can Calculate.  IF I have the value of the Previous Bar Can I calculate the Value of the Price (C) that would create a Current Indicator Value of 100 or 0 for the Above Indicator using 3 Period, 6 Period, and 8 Period.  The Following 3 Formulas are formulas for the Previous Bar Value:

100 * (C1-MINC3.1) /( MAXC3.1 -MINC3.1)

100 * (C1-MINC6.1) /( MAXC6.1 -MINC6.1)

100 * (C1-MINC8.1) /( MAXC8.1 -MINC8.1)

 

Thanks

 

 
diceman
Posted : Monday, February 15, 2016 4:20:59 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

The first measures the close based on the close range.

The second measures the close based on the high low range.

 

 

 

 

Thanks

diceman

 

 

 

Bruce_L
Posted : Tuesday, February 16, 2016 10:59:55 AM


Worden Trainer

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

Assuming you want to use your formulas based on the close instead of basing the formulas on the entire range then the 3 period version will be 100 when:

C >= MAXC2.1

And 0 when:

C <= MINC2.1

The same basic format will work for the 6 period version. 100 when:

C >= MAXC5.1

And 0 when:

C <= MINC5.1

And for the 8 period version. 100 when:

C >= MAXC7.1

And 0 when:

C <= MINC7.1

 



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
MoreAces
Posted : Tuesday, February 16, 2016 11:34:31 AM
Registered User
Joined: 8/23/2013
Posts: 245

so for the 8 period, the Price would be the MAXC7.1

Bruce_L
Posted : Tuesday, February 16, 2016 11:38:46 AM


Worden Trainer

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

Price would need to be at or above MAXC7.1 in order for your stochastic based entirely on closing prices to be 100.

More strictly though price needs to be at or MAXC7.1 and above MINC7.1. The reason for this is if all eight closing prices are the same, you would get a division by zero error. With a normal stochastic, this would be resolved by arbitrarily assigning the stochastic a value of 50.



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