StockFetcher Forums · General Discussion · PRICE ACTION STATE CHANGE<< 1 2 3 >>Post Follow-up
TheRumpledOne
6,407 posts
msg #160193
Ignore TheRumpledOne
modified
3/28/2023 11:21:36 AM

PRICE ACTION

“Now, 2 patterns of market behavior happen on a regular basis:
1) the price breaks to new highs (or lows)
2) the price reverses from new highs (or lows)
They happen regardless of time frame .
They are phenomena that can be exploited without the fear if found out by others, that they might cease to
exist.” - H. Rearden

1) Price will either breakout of the high, low or both of the previous bar
2) Price will not breakout of the previous bar.
3) Price will either close above a level (line) or not.

You cannot reduce it any further. Anything else complicates the issue.

STATE CHANGE

There are 4 states:

1 - Higher High and Higher Low (HH)
2 - Lower HIgh and Lower Low (LL)
3 - Higher High and Lower Low (OB - Outside Bar)
4 - Lower High and High Low (IB - Inside Bar)


Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

and add column separator

and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


/* END CALCULATIONS */


add column industry

/* SELECTION CRITERIA */

price above 10
volume above 1000000

sort column 4 descending
]



You can see the state in the columns HH, LL, IB, OB

TheRumpledOne
6,407 posts
msg #160194
Ignore TheRumpledOne
modified
3/28/2023 11:24:51 AM

To see stocks in the higher high state 2 days in a row

Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

and add column separator

and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


/* END CALCULATIONS */


add column industry

/* SELECTION CRITERIA */

HH above 0
HH1 above 0

price above 10
volume above 1000000

sort column 4 descending
]



You can see the state in the columns HH, LL, IB, OB

TheRumpledOne
6,407 posts
msg #160195
Ignore TheRumpledOne
modified
3/28/2023 11:26:58 AM

To see stocks in the Outside Bar State



Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

and add column separator

and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


/* END CALCULATIONS */


add column industry

/* SELECTION CRITERIA */

OB above 0


price above 10
volume above 1000000

sort column 4 descending
]



You can see the state in the columns HH, LL, IB, OB

TheRumpledOne
6,407 posts
msg #160196
Ignore TheRumpledOne
3/28/2023 11:30:00 AM

To see stocks in the Inside Bar State 2 days in a row:

Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

and add column separator

and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


/* END CALCULATIONS */


add column industry

/* SELECTION CRITERIA */

IB above 0
IB1 above 0

price above 10
volume above 1000000

sort column 4 descending
]



15minofPham
168 posts
msg #160197
Ignore 15minofPham
3/28/2023 11:32:04 AM

TRO is back! But for how long?

TheRumpledOne
6,407 posts
msg #160198
Ignore TheRumpledOne
modified
3/28/2023 11:39:14 AM

HHHLdays is number of days of higher highers and higher lows.

LHLLdays is number of days of lower highs and lower lows.


Of course, you can sort those columns as you please.


Submit
Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }


set{HHHLdays,days(HH equals 0 1 day ago ,100)}
set{LHLLdays,days(LL equals 0 1 day ago ,100)}
set{IBdays,days(IB equals 0 day ago ,100)}
set{OBdays,days(OB equals 0 1 day ago ,100)}

and add column separator
and add column HHHLdays
and add column LHLLdays
and add column IBdays
and add column OBdays

and add column separator
and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


/* END CALCULATIONS */


add column industry

/* SELECTION CRITERIA */


price above 10
volume above 1000000

sort column 6 descending
]



Remember the column separator counts as a column!



TheRumpledOne
6,407 posts
msg #160199
Ignore TheRumpledOne
3/28/2023 11:59:55 AM

15minofPham I noticed something in Forex and coded it. I am applying it to equities here.

If you wait for a state change, usually the next bar makes a nice move.

You may want to watch my YouTube channel for trading tips. https://www.youtube.com/therumpledone

I will do videos about state change.







15minofPham
168 posts
msg #160202
Ignore 15minofPham
3/28/2023 12:48:54 PM

Sounds good TRO. As always, thank you for your contribution. Too bad there isn't a way to backtest this to find out how much the avg move is before it ends.

TheRumpledOne
6,407 posts
msg #160203
Ignore TheRumpledOne
modified
3/28/2023 3:16:53 PM

Logic included to show only stocks that changed state

Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/


/* CALCULATIONS */
set{CCb,days(close is above close 1 day ago,100)}
set{CCa,days(close is below close 1 day ago,100)}
set{ClxCl, CCa - CCb}

set{E5b,days(close is above ema(5),100)}
set{E5a,days(close is below ema(5),100)}
set{CxEma5, E5a - E5b}

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

set{HHHLdays,days(HH is below 1 1 day ago,100)}
set{LHLLdays,days(LL is below 1 1 day ago,100)}


Set{p1, OB * 1}
Set{p2, IB * 10}
Set{p3, LL * 100}
Set{p4, HH * 1000}

Set{pa, p1 + p2}
Set{pb, p3 + p4}
Set{STATE0, pa + pb}


Set{p1x, OB1* 1}
Set{p2x, IB1 * 10}
Set{p3x, LL1 * 100}
Set{p4x, HH1 * 1000}

Set{pax, p1x + p2x}
Set{pbx, p3x + p4x}
Set{STATE1, pax + pbx}



Set{STATE , STATE0 - STATE1}

and add column separator
and add column HHHLdays
and add column LHLLdays
and add column separator

and add column STATE0
and add column STATE1
and add column separator
and add column HH
and add column LL
and add column IB
and add column OB
and add column separator

and add column HH1
and add column LL1
and add column IB1
and add column OB1
and add column separator


and add column clxcl
and add column CxEma5



add column industry

/* SELECTION CRITERIA */

STATE above 0

volume above 1000000

sort column 6 descending

draw STATE
]





TheRumpledOne
6,407 posts
msg #160204
Ignore TheRumpledOne
modified
3/28/2023 3:20:00 PM

Same as above without all of the state columns.

When price changes state "something" is going to happen.

Fetcher[
/* PRICE ACTION STATE CHANGE */
/* Copyright 2023 by Avery T. Horton, Jr. aka The Rumpled One */
/* Permission to use PRICE ACTION STATE CHANGE within StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/


/* CALCULATIONS */
set{CCb,days(close is above close 1 day ago,100)}
set{CCa,days(close is below close 1 day ago,100)}
set{ClxCl, CCa - CCb}

set{E5b,days(close is above ema(5),100)}
set{E5a,days(close is below ema(5),100)}
set{CxEma5, E5a - E5b}

/* CALCULATIONS */

set{xHH,count(high is above high 1 day ago,1)}
set{xLL,count(low is below low 1 day ago,1)}

set{xHH1,count(high 1 day ago is above high 2 days ago,1)}
set{xLL1,count(low 1 day ago is below low 2 days ago,1)}

set{xLH,count(high is below high 1 day ago,1)}
set{xHL,count(low is above low 1 day ago,1)}

set{xLH1,count(high 1 day ago is below high 2 day ago,1)}
set{xHL1,count(low 1 day ago is above low 2 day ago,1)}

set{HH, xHH * xHL }
set{LL, xLL * xLH }
set{IB, xLH * xHL }
set{OB, xHH * xLL }

set{HH1, xHH1 * xHL1 }
set{LL1, xLL1 * xLH1 }
set{IB1, xLH1 * xHL1 }
set{OB1, xHH1 * xLL1 }

set{HHHLdays,days(HH is below 1 1 day ago,100)}
set{LHLLdays,days(LL is below 1 1 day ago,100)}


Set{p1, OB * 1}
Set{p2, IB * 10}
Set{p3, LL * 100}
Set{p4, HH * 1000}

Set{pa, p1 + p2}
Set{pb, p3 + p4}
Set{STATE0, pa + pb}


Set{p1x, OB1* 1}
Set{p2x, IB1 * 10}
Set{p3x, LL1 * 100}
Set{p4x, HH1 * 1000}

Set{pax, p1x + p2x}
Set{pbx, p3x + p4x}
Set{STATE1, pax + pbx}



Set{STATE , STATE0 - STATE1}

and add column separator
and add column HHHLdays
and add column LHLLdays
and add column separator

and add column STATE0



and add column clxcl
and add column CxEma5



add column industry

/* SELECTION CRITERIA */

STATE above 0

volume above 1000000

sort column 6 descending

draw STATE
]



StockFetcher Forums · General Discussion · PRICE ACTION STATE CHANGE<< 1 2 3 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.