Join useThinkScript to post your question to a community of 21,000+ developers and traders.
This is going a bit beyond my scope...but i managed to successfully make a “strategy” and code it for something else so i know how to modify...it seems like you may already have most of the code to create this (i will help as much as i can) but i thought it may be great to have a strategy that would identify actionable signals on the chart but perhaps narrow down the probability further. For example could use the 30 min or hourly chart. The strategy would be on the 30 min chart and would only create an actionable signal if there was FTC in that direction. I also have a study that does already put in the lines for the entry and stop price. So could rework those to all scenarios and could perhaps help identifying stronger signals. Eg. a 30 min rev Strat 3-1-2 reversal that also puts in force a FTC onto the daily or weekly etc. i think would really help narrrow down a focus on a list of names or perhaps help in terms of a possible scan or watchlist item. Just a thoughtI just completed the preloaded charts with their own TFC studies so the background color stays the same. Top post.
so digging deeper i see you have the same idea and have not released yet! i wold love to have a look at this code if you would care to share it!This is going a bit beyond my scope...but i managed to successfully make a “strategy” and code it for something else so i know how to modify...it seems like you may already have most of the code to create this (i will help as much as i can) but i thought it may be great to have a strategy that would identify actionable signals on the chart but perhaps narrow down the probability further. For example could use the 30 min or hourly chart. The strategy would be on the 30 min chart and would only create an actionable signal if there was FTC in that direction. I also have a study that does already put in the lines for the entry and stop price. So could rework those to all scenarios and could perhaps help identifying stronger signals. Eg. a 30 min rev Strat 3-1-2 reversal that also puts in force a FTC onto the daily or weekly etc. i think would really help narrrow down a focus on a list of names or perhaps help in terms of a possible scan or watchlist item. Just a thought
It's all still very embryonic when it comes to the strategy studies. Working on itso digging deeper i see you have the same idea and have not released yet! i wold love to have a look at this code if you would care to share it!
That's an interesting concept indeed! Let me see what I can do. I need to revisit the REMIX study anywayPelonsax,
Is it possible for you to put an entry line with notes, for us learning the strat. Maybe something like : 'No Trade Zone: Inside bar forming, enter upon take out of previous range. That way we are waiting fo the signal and set up for the move once it triggers. That way it teaches us the strat as it signals to us?
That would be awesome. Your studies are already better than any other ones I have seen out their. That would just take it to the next level and make it the most popular study for those wanting to learn this style of trading.That's an interesting concept indeed! Let me see what I can do. I need to revisit the REMIX study anyway
Thank you very much for your kind words!That would be awesome. Your studies are already better than any other ones I have seen out their. That would just take it to the next level and make it the most popular study for those wanting to learn this style of trading.
@Pelonsax I have really enjoyed your YouTube videos on Strat and have subscribed as well. Is there a update version of the Strat, because while watching the video on actionable signal my thinkscript isn't the same. Is there anyway that you could post the entire thinkscript if it's not too much trouble? For example I have a separate kicking bulls and alerts. You did an excellent job. Thanks again.Thank you very much for your kind words!
All of the most updated versions are in the top post, and I try to document the changes as well, but I have gone through several iterations of these and am constantly trying to improve them, so it could be that you watched a video that involved a previous version that is no longer available because it has been improved/replaced@Pelonsax I have really enjoyed your YouTube videos on Strat and have subscribed as well. Is there a update version of the Strat, because while watching the video on actionable signal my thinkscript isn't the same. Is there anyway that you could post the entire thinkscript if it's not too much trouble? For example I have a separate kicking bulls and alerts. You did an excellent job. Thanks again.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KivancOzbilgic
//@version=4
study("Trend Magic", shorttitle="TM", overlay=true, format=format.price, precision=2, resolution="")
period=input(20,"CCI period")
coeff=input(1,"ATR Multiplier")
AP=input(5,"ATR Period")
ATR=sma(tr,AP)
src=input(close)
upT=low-ATR*coeff
downT=high+ATR*coeff
MagicTrend=0.0
MagicTrend := cci(src,period)>=0 ? (upT<nz(MagicTrend[1]) ? nz(MagicTrend[1]) : upT) : (downT>nz(MagicTrend[1]) ? nz(MagicTrend[1]) : downT)
color1= cci(src,period)>=0 ? #0022FC : #FC0400
plot(MagicTrend, color=color1, linewidth=3)
alertcondition(cross(close, MagicTrend), title="Cross Alert", message="Price - MagicTrend Crossing!")
alertcondition(crossover(low, MagicTrend), title="CrossOver Alarm", message="BUY SIGNAL!")
alertcondition(crossunder(high, MagicTrend), title="CrossUnder Alarm", message="SELL SIGNAL!")
I have noticed that 2-2 reversals dont seem to show up on the actionable signals?In order to keep the post clean, updates are now found at the very bottom of the thread
NEWEST: 04/01/21
ROB SMITH’S THE STRAT: A SUITE OF PRODUCTS BY PELONSAX AKA RAMON DV
I am writing these to help myself learn The STRAT because I am a visual learner. And I am sharing them because many generous people have shared their time and expertise with me along my journey and we can do more when we work together.
But before we get to all of that, here is a link to a really great video that Rob just recorded for Benzinga where he gives a GREAT introduction to The STRAT. It is NOT recommended that you use any of my indicators for trading with live money until you've had the chance to gain a real understanding of how The STRAT works and given yourself ample opportunity to practice on paper.
Here's the video: https://benzinga.wistia.com/medias/zoi6e794v3?fbclid=IwAR06RBtG0bimZcgyDuryjd12K7BdbDPCdkrE-O0k3hcT7JvMsk889v8qv3c
Keep in mind that I am not the creator of The STRAT. I am a disciple who has been creating these TOS studies along the way in my journey to learn this system and be able to visualize how it works. For more information on the STRAT, and to really learn how to use it to trade effectively with or without any of my studies, please visit Rob on Ticker Tocker!!
https://www.tickertocker.com/?fbclid=IwAR1ZDPKpTX2WzOrnOFqFuMOw5Wx_u4eTZoxco8-yZeBIObQJHQsYmZAakQU
!!!VERY IMPORTANT!!!! The arrows are there to help aid in the optics of the reversals (along with the bubbles). THEY ARE NOT BUY AND SELL SIGNALS. The decision to buy or sell MUST BE predicated upon a deeper understanding of this system and any other tools at your disposal. As a matter of fact this study only considers the four basic reversals. You can turn both the arrows and the bubbles off in the settings so they don't clutter your chart.
Lastly, I would like to point out that this is an active thread that is constantly evolving as I continue to improve and add to these studies. If you have questions or comments about them I just ask, as I noted above, that you first make sure you are referring to the most recent version of a particular study and that you be very specific using screenshots in any such comments.
For those of you from Twitter who are just here for the bare essentials, here are two very basic studies:
STRAT BAR NUMBERS
https://tos.mx/tyzaGXU
Code:#------------------------------------ # S T R A T N U M B E R S # # A study by Ramon DV. aka Pelonsax # # Version 1.0 8/01/20 # # Version 2.0 8/4/20 Corrected errors in logic for scenarios # #------------------------------------ #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def H = high; def L = low; def C = close; def O = open; def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]); def outsidebar = H > H[1] and L < L[1]; def twoup = H > H[1] and L >= L[1]; def twodown = H <= H[1] and L < L[1]; #------------------------------------ # STRAT NUMBERS #------------------------------------ input Show_Strat_Numbers = yes; input Show_Twos = yes; plot barType = if Show_Strat_Numbers and insideBar then 1 else if Show_Strat_Numbers and outsidebar then 3 else if !insidebar and !outsidebar and Show_Twos then 2 else double.nan; barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); barType.SetDefaultColor(color.cyan);
STRAT BAR CANDLES PAINT ON ONES AND THREES WITH NUMBERS BELOW
https://tos.mx/jdHvqj4
Add the following line to the code above down at the very bottom:
assignPriceColor(if insidebar then color.yellow else if outsidebar then color.magenta else color.current);
MAIN STUDIES:
TIME_FRAME_CONTINUITY
https://tos.mx/JZROQzW
STRAT_REMIX
https://tos.mx/TIahWNg
STRAT_REMIX_LITE
https://tos.mx/ZoCLHj1
Same as the REMIX but with candle paint only on Inside Bars, Outside Bars, and Reversals. Allows user to turn toggle each.
VIDEO TUTORIAL FOR MAIN STUDIES:
HAMMERS AND SHOOTERS
This study is ONLY meant to allow the user to find the best settings for the hammer and shooting star component of the Remix study and Actionable Signals studies. All it does is find Hammers and Shooters using the same code in those other studies and paints them green or red while all other candles are painted gray. With this study you can tweak the settings in a way that best serves your purposes and then transfer those settings to the Strat studies.
Hammers_N_Shooters
https://tos.mx/zGPo4F4
NEW FULL COLOR VERSION OF OVERLAYS
These work great on a white chart
Darkest shade of green/red Version 1: https://tos.mx/tjloQ7e (the lowest time frame)
Medium shade of green/red Version 2:https://tos.mx/TCdGJMZ
Medium shade of green/red Version 3: https://tos.mx/tRTlDa1
Lightest shade of green/red Version 4: https://tos.mx/ZRF4K8Z(the highest time frame)
Pre-Loaded intraday chart: https://tos.mx/q7Bfm3J (Now complete with TFC study!)
Pre-Loaded full chart: https://tos.mx/jSJp52F (Now complete with TFC study!)
I find these are the best settings to the overall appearance the chart if you're using the green/red overlays:
SIMPLE WATCHLIST COLUMNS
Here's what they look like:
Here is a code for STRAT Candle watchlist column:
Code:#------------------------------------ # # M T F S T R A T # W A T C H L I S T # a Study by Ramon DV. aka Pelonsax # #------------------------------------ #------------------------------------ # S T R A T R E V E R S A L S # # A study by Ramon DV. aka Pelonsax # # Version 1.0 8/01/20 # # Version 2.0 8/4/20 Corrected errors in logic for scenarios # Version 2.1 8/15/20 Added Reversals # #------------------------------------ def H = high; def L = low; def O = open; def C = close; #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]); def outsidebar = H > H[1] and L < L[1]; def insidebarup = insidebar and O < C; def twoup = H > H[1] and L >= L[1]; def outsidebarup = outsidebar and O < C; def insidebardown = insidebar and O > C; def twodown = H <= H[1] and L < L[1]; def outsidebardown = outsidebar and O > C; #------------------------------------ # LABEL SECTION #------------------------------------ AddLabel(yes, if twoup then “2U” else if twodown then “2D” else if insidebarup then “1U" else if insidebardown then “1D” else if outsidebarup then “3U” else if outsidebardown then “3D” else if insidebar and !insidebarup and !insidebardown then "1" else if outsidebar and !outsidebarup and !outsidebardown then "3" else "", color.black); assignbackgroundColor( if twoup then color.green else if twodown then color.red else if outsidebarup then color.dark_green else if insidebarup then color.light_green else if outsidebardown then color.dark_red else if insidebardown then color.orange else if !insidebarup and !insidebardown and insidebar then color.white else if !outsidebardown and !outsidebarup and outsidebar then color.white else color.current);
Here is a code for FTC Watchlist columns:
·Code:#S T R A T F T C #WATCHLIST #Ramon DV aka Pelonsax plot O = open; def C = close; assignBackgroundColor(if C > O then color.GREEN else if O > C then color.RED else if O == C then color.white else color.current); addlabel(yes, O, color.black); # END
MORE MTF STUDIES
Here is a Multi Time Frame (MTF) Study for labels that use my logic to indicate the condition of the current bar (the number farthest to the right surrounded by brackets. You read it from left to right) and the two previous bars on that time frame. The color of the label is determined by one of two conditions: the type of STRAT bar that is the current bar using the color scheme that is found throughout all of my studies or cyan or magenta indicating one of the four basic reversals described by Rob in his interview with Steve Burns. The intraday version has 1m 5m 15m 30m 60m. The Full version has D W M Y
NEW_STRAT_MTF_LABEL_w_REVERSALS-INTRADAY
https://tos.mx/UFu0igM
Code for the intraday study (the full study is similar, but with higher time frames):
Code:# ----------------------------------- # S T R A T L A B E L S w/REVERSALS # A STUDY BY RAMON DV AKA PELONSAX # ----------------------------------- declare upper; #------------------------------------ # ASSIGN COLORS #------------------------------------ DefineGlobalColor("3U”, CreateColor(002, 092, 000)); DefineGlobalColor("2U”, CreateColor(002, 255, 000)); DefineGlobalColor("1U”, CreateColor(000, 255, 121)); DefineGlobalColor("3D”, CreateColor(138, 000, 020)); DefineGlobalColor("2D”, CreateColor(255, 000, 030)); DefineGlobalColor("1D”, CreateColor(255, 166, 161)); # ----------------------------------- # Minute Label # ----------------------------------- def min = AggregationPeriod.MIN; def Vminute = GetAggregationPeriod() <= AggregationPeriod.MIN; def minuteO; def minuteC; def minuteH; def minuteL; if Vminute { minuteO = open(period = min); minuteC = close(period = min); minuteH = high(period = min); minuteL = low(period = min); } else { minuteO = Double.NaN; minuteC = Double.NaN; minuteH = Double.NaN; minuteL = Double.NaN; } #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def minute_insidebar = (minuteH < minuteH[1] and minuteL > minuteL[1]) or (minuteH == minuteH[1] and minuteL > minuteL[1]) or (minuteH < minuteH[1] and minuteL == minuteL[1]) or (minuteH == minuteH[1] and minuteL == minuteL[1]); def minute_outsidebar = minuteH > minuteH[1] and minuteL < minuteL[1]; def minute_insidebarup = minute_insidebar and minuteO < minuteC; def minute_twoup = minuteH > minuteH[1] and minuteL >= minuteL[1]; def minute_outsidebarup = minute_outsidebar and minuteO < minuteC; def minute_insidebardown = minute_insidebar and minuteO > minuteC; def minute_twodown = minuteH <= minuteH[1] and minuteL < minuteL[1]; def minute_outsidebardown = minute_outsidebar and minuteO > minuteC; def minute_pivot_high = minuteH >= Highest(minuteH[1], 6) and minuteH > Highest(minuteH[-2], 2); def minute_pivot_low = minuteL <= Lowest(minuteL[1], 6) and minuteL < Lowest(minuteL[-2], 2); #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def minute_TwoOneTwoBull = minute_twoup and minute_insidebar[1] and minute_twodown[2]; def minute_TwoTwoBull = minute_twoup and minute_twodown[1]; def minute_ThreeBull = minute_outsidebarup and (minute_twodown[1] or minute_insidebar[1] or minute_outsidebardown[1]); def minute_ThreeOneTwoBull = minute_twoup and minute_insidebar[1] and minute_outsidebardown[2] and minute_pivot_low[2]; # Bearish def minute_TwoOneTwoBear = minute_twodown and minute_insidebar[1] and minute_twoup[2]; def minute_TwoTwoBear = minute_twodown and minute_twoup[1]; def minute_ThreeBear = minute_outsidebardown and (minute_twoup[1] or minute_insidebar[1] or minute_outsidebarup[1]); def minute_ThreeOneTwoBear = minute_twodown and minute_insidebar[1] and minute_outsidebarup[2] and minute_pivot_high[2]; AddLabel(!IsNaN(minuteO), ( (if minute_twoup[2] then “2U” else if minute_twodown[2] then “2D” else if minute_insidebarup[2] then “1U" else if minute_insidebardown[2] then “1D” else if minute_outsidebarup[2] then “3U” else if minute_outsidebardown[2] then “3D” else if minute_insidebar[2] and !minute_insidebarup[2] and !minute_insidebardown[2] then "1" else if minute_outsidebar[2] and !minute_outsidebarup[2] and !minute_outsidebardown[2] then "3" else "") + “-“ + (if minute_twoup[1] then “2U” else if minute_twodown[1] then “2D” else if minute_insidebarup[1] then “1U" else if minute_insidebardown[1] then “1D” else if minute_outsidebarup[1] then “3U” else if minute_outsidebardown[1] then “3D” else if minute_insidebar[1] and !minute_insidebarup[1] and !minute_insidebardown[1] then "1" else if minute_outsidebar[1] and !minute_outsidebarup[1] and !minute_outsidebardown[1] then "3" else "") + “-“ + (if minute_twoup then “[2U]” else if minute_twodown then “[2D]” else if minute_insidebarup then “[1U]" else if minute_insidebardown then “[1D]” else if minute_outsidebarup then “[3U]” else if minute_outsidebardown then “[3D]” else if minute_insidebar and !minute_insidebarup and !minute_insidebardown then "[1]" else if minute_outsidebar and !minute_outsidebarup and !minute_outsidebardown then "[3]" else "") + " 1 min" + “ “ ), if minute_TwoOneTwoBull or minute_TwoTwoBull or minute_ThreeBull or minute_ThreeOneTwoBull then color.cyan else if minute_TwoOneTwoBear or minute_TwoTwoBear or minute_ThreeBear or minute_ThreeOneTwoBear then color.magenta else if !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_twoup then GlobalColor("2U”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_twodown then GlobalColor("2D”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_outsidebarup then GlobalColor("3U”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_insidebarup then GlobalColor("1U”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_outsidebardown then GlobalColor("3D”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and minute_insidebardown then GlobalColor("1D”) else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and !minute_insidebarup and !minute_insidebardown and minute_insidebar then color.white else if !minute_TwoOneTwoBull and !minute_TwoTwoBull and !minute_ThreeBull and !minute_ThreeOneTwoBull and !minute_TwoOneTwoBear and !minute_TwoTwoBear and !minute_ThreeBear and !minute_ThreeOneTwoBear and !minute_outsidebardown and !minute_outsidebarup and minute_outsidebar then color.white else color.current); # ----------------------------------- # Five Label # ----------------------------------- def five = AggregationPeriod.five_min; def Vfive = GetAggregationPeriod() <= AggregationPeriod.five_min; def fiveO; def fiveC; def fiveH; def fiveL; def fiveO1; def fiveC1; def fiveH1; def fiveL1; def fiveO2; def fiveC2; def fiveH2; def fiveL2; if Vfive { fiveO = open(period = five); fiveC = close(period = five); fiveH = high(period = five); fiveL = low(period = five); fiveO1 = open(period = five)[1]; fiveC1 = close(period = five)[1]; fiveH1 = high(period = five)[1]; fiveL1 = low(period = five)[1]; fiveO2 = open(period = five)[2]; fiveC2 = close(period = five)[2]; fiveH2 = high(period = five)[2]; fiveL2 = low(period = five)[2]; } else { fiveO = Double.NaN; fiveC = Double.NaN; fiveH = Double.NaN; fiveL = Double.NaN; fiveO1 = Double.NaN; fiveC1 = Double.NaN; fiveH1 = Double.NaN; fiveL1 = Double.NaN; fiveO2 = Double.NaN; fiveC2 = Double.NaN; fiveH2 = Double.NaN; fiveL2 = Double.NaN; } #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def five_insidebar = (fiveH < fiveH[1] and fiveL > fiveL[1]) or (fiveH == fiveH[1] and fiveL > fiveL[1]) or (fiveH < fiveH[1] and fiveL == fiveL[1]) or (fiveH == fiveH[1] and fiveL == fiveL[1]); def five_outsidebar = fiveH > fiveH[1] and fiveL < fiveL[1]; def five_insidebarup = five_insidebar and fiveO < fiveC; def five_twoup = fiveH > fiveH[1] and fiveL >= fiveL[1]; def five_outsidebarup = five_outsidebar and fiveO < fiveC; def five_insidebardown = five_insidebar and fiveO > fiveC; def five_twodown = fiveH <= fiveH[1] and fiveL < fiveL[1]; def five_outsidebardown = five_outsidebar and fiveO > fiveC; def five_insidebar1 = (fiveH1 < fiveH1[1] and fiveL1 > fiveL1[1]) or (fiveH1 == fiveH1[1] and fiveL1 > fiveL1[1]) or (fiveH1 < fiveH1[1] and fiveL1 == fiveL1[1]) or (fiveH1 == fiveH1[1] and fiveL1 == fiveL1[1]); def five_outsidebar1 = fiveH1 > fiveH1[1] and fiveL1 < fiveL[11]; def five_insidebarup1 = five_insidebar1 and fiveO1 < fiveC1; def five_twoup1 = fiveH1 > fiveH1[1] and fiveL1 >= fiveL1[1]; def five_outsidebarup1 = five_outsidebar1 and fiveO1 < fiveC1; def five_insidebardown1 = five_insidebar1 and fiveO1 > fiveC1; def five_twodown1 = fiveH1 <= fiveH1[1] and fiveL1 < fiveL1[1]; def five_outsidebardown1 = five_outsidebar1 and fiveO1 > fiveC1; def five_insidebar2 = (fiveH2 < fiveH2[1] and fiveL2 > fiveL2[1]) or (fiveH2 == fiveH2[1] and fiveL2 > fiveL2[1]) or (fiveH2 < fiveH2[1] and fiveL2 == fiveL2[1]) or (fiveH2 == fiveH2[1] and fiveL2 == fiveL2[1]); def five_outsidebar2 = fiveH2 > fiveH2[1] and fiveL2 < fiveL2[1]; def five_insidebarup2 = five_insidebar2 and fiveO2 < fiveC2; def five_twoup2 = fiveH2 > fiveH2[1] and fiveL2 >= fiveL2[1]; def five_outsidebarup2 = five_outsidebar2 and fiveO2 < fiveC2; def five_insidebardown2 = five_insidebar2 and fiveO2 > fiveC2; def five_twodown2 = fiveH2 <= fiveH2[1] and fiveL2 < fiveL2[1]; def five_outsidebardown2 = five_outsidebar2 and fiveO2 > fiveC2; #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def five_TwoOneTwoBull = five_twoup and five_insidebar[1] and five_twodown[2]; def five_TwoTwoBull = five_twoup and five_twodown[1]; def five_ThreeBull = five_outsidebarup and (five_twodown[1] or five_insidebar[1] or five_outsidebardown[1]); def five_ThreeOneTwoBull = five_twoup and five_insidebar[1] and five_outsidebardown[2]; # Bearish def five_TwoOneTwoBear = five_twodown and five_insidebar[1] and five_twoup[2]; def five_TwoTwoBear = five_twodown and five_twoup[1]; def five_ThreeBear = five_outsidebardown and (five_twoup[1] or five_insidebar[1] or five_outsidebarup[1]); def five_ThreeOneTwoBear = five_twodown and five_insidebar[1] and five_outsidebarup[2]; AddLabel(!IsNaN(fiveO), ( (if five_twoup2 then “2U” else if five_twodown2 then “2D” else if five_insidebarup2 then “1U" else if five_insidebardown2 then “1D” else if five_outsidebarup2 then “3U” else if five_outsidebardown2 then “3D” else if five_insidebar2 and !five_insidebarup2 and !five_insidebardown2 then "1" else if five_outsidebar2 and !five_outsidebarup2 and !five_outsidebardown2 then "3" else "") + “-“ + (if five_twoup1 then “2U” else if five_twodown1 then “2D” else if five_insidebarup1 then “1U" else if five_insidebardown1 then “1D” else if five_outsidebarup1 then “3U” else if five_outsidebardown1 then “3D” else if five_insidebar1 and !five_insidebarup1 and !five_insidebardown1 then "1" else if five_outsidebar1 and !five_outsidebarup1 and !five_outsidebardown1 then "3" else "") + “-“ + (if five_twoup then “[2U]” else if five_twodown then “[2D]” else if five_insidebarup then “[1U]" else if five_insidebardown then “[1D]” else if five_outsidebarup then “[3U]” else if five_outsidebardown then “[3D]” else if five_insidebar and !five_insidebarup and !five_insidebardown then "[1]" else if five_outsidebar and !five_outsidebarup and !five_outsidebardown then "[3]" else "") + “ 5 min" + “ “ ), if five_TwoOneTwoBull or five_TwoTwoBull or five_ThreeBull or five_ThreeOneTwoBull then color.cyan else if five_TwoOneTwoBear or five_TwoTwoBear or five_ThreeBear or five_ThreeOneTwoBear then color.magenta else if !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_twoup then GlobalColor("2U”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_twodown then GlobalColor("2D”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_outsidebarup then GlobalColor("3U”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_insidebarup then GlobalColor("1U”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_outsidebardown then GlobalColor("3D”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and five_insidebardown then GlobalColor("1D”) else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and !five_insidebarup and !five_insidebardown and five_insidebar then color.white else if !five_TwoOneTwoBull and !five_TwoTwoBull and !five_ThreeBull and !five_ThreeOneTwoBull and !five_TwoOneTwoBear and !five_TwoTwoBear and !five_ThreeBear and !five_ThreeOneTwoBear and !five_outsidebardown and !five_outsidebarup and five_outsidebar then color.white else color.current); # ----------------------------------- # Fifteen Label # ----------------------------------- def fifteen = AggregationPeriod.fifteen_min; def Vfifteen = GetAggregationPeriod() <= AggregationPeriod.fifteen_min; def fifteenO; def fifteenC; def fifteenH; def fifteenL; def fifteenO1; def fifteenC1; def fifteenH1; def fifteenL1; def fifteenO2; def fifteenC2; def fifteenH2; def fifteenL2; if Vfifteen { fifteenO = open(period = fifteen); fifteenC = close(period = fifteen); fifteenH = high(period = fifteen); fifteenL = low(period = fifteen); fifteenO1 = open(period = fifteen)[1]; fifteenC1 = close(period = fifteen)[1]; fifteenH1 = high(period = fifteen)[1]; fifteenL1 = low(period = fifteen)[1]; fifteenO2 = open(period = fifteen)[2]; fifteenC2 = close(period = fifteen)[2]; fifteenH2 = high(period = fifteen)[2]; fifteenL2 = low(period = fifteen)[2]; } else { fifteenO = Double.NaN; fifteenC = Double.NaN; fifteenH = Double.NaN; fifteenL = Double.NaN; fifteenO1 = Double.NaN; fifteenC1 = Double.NaN; fifteenH1 = Double.NaN; fifteenL1 = Double.NaN; fifteenO2 = Double.NaN; fifteenC2 = Double.NaN; fifteenH2 = Double.NaN; fifteenL2 = Double.NaN; } #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def fifteen_insidebar = (fifteenH < fifteenH[1] and fifteenL > fifteenL[1]) or (fifteenH == fifteenH[1] and fifteenL > fifteenL[1]) or (fifteenH < fifteenH[1] and fifteenL == fifteenL[1]) or (fifteenH == fifteenH[1] and fifteenL == fifteenL[1]); def fifteen_outsidebar = fifteenH > fifteenH[1] and fifteenL < fifteenL[1]; def fifteen_insidebarup = fifteen_insidebar and fifteenO < fifteenC; def fifteen_twoup = fifteenH > fifteenH[1] and fifteenL >= fifteenL[1]; def fifteen_outsidebarup = fifteen_outsidebar and fifteenO < fifteenC; def fifteen_insidebardown = fifteen_insidebar and fifteenO > fifteenC; def fifteen_twodown = fifteenH <= fifteenH[1] and fifteenL < fifteenL[1]; def fifteen_outsidebardown = fifteen_outsidebar and fifteenO > fifteenC; def fifteen_insidebar1 = (fifteenH1 < fifteenH1[1] and fifteenL1 > fifteenL1[1]) or (fifteenH1 == fifteenH1[1] and fifteenL1 > fifteenL1[1]) or (fifteenH1 < fifteenH1[1] and fifteenL1 == fifteenL1[1]) or (fifteenH1 == fifteenH1[1] and fifteenL1 == fifteenL1[1]); def fifteen_outsidebar1 = fifteenH1 > fifteenH1[1] and fifteenL1 < fifteenL[11]; def fifteen_insidebarup1 = fifteen_insidebar1 and fifteenO1 < fifteenC1; def fifteen_twoup1 = fifteenH1 > fifteenH1[1] and fifteenL1 >= fifteenL1[1]; def fifteen_outsidebarup1 = fifteen_outsidebar1 and fifteenO1 < fifteenC1; def fifteen_insidebardown1 = fifteen_insidebar1 and fifteenO1 > fifteenC1; def fifteen_twodown1 = fifteenH1 <= fifteenH1[1] and fifteenL1 < fifteenL1[1]; def fifteen_outsidebardown1 = fifteen_outsidebar1 and fifteenO1 > fifteenC1; def fifteen_insidebar2 = (fifteenH2 < fifteenH2[1] and fifteenL2 > fifteenL2[1]) or (fifteenH2 == fifteenH2[1] and fifteenL2 > fifteenL2[1]) or (fifteenH2 < fifteenH2[1] and fifteenL2 == fifteenL2[1]) or (fifteenH2 == fifteenH2[1] and fifteenL2 == fifteenL2[1]); def fifteen_outsidebar2 = fifteenH2 > fifteenH2[1] and fifteenL2 < fifteenL2[1]; def fifteen_insidebarup2 = fifteen_insidebar2 and fifteenO2 < fifteenC2; def fifteen_twoup2 = fifteenH2 > fifteenH2[1] and fifteenL2 >= fifteenL2[1]; def fifteen_outsidebarup2 = fifteen_outsidebar2 and fifteenO2 < fifteenC2; def fifteen_insidebardown2 = fifteen_insidebar2 and fifteenO2 > fifteenC2; def fifteen_twodown2 = fifteenH2 <= fifteenH2[1] and fifteenL2 < fifteenL2[1]; def fifteen_outsidebardown2 = fifteen_outsidebar2 and fifteenO2 > fifteenC2; #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def fifteen_TwoOneTwoBull = fifteen_twoup and fifteen_insidebar[1] and fifteen_twodown[2]; def fifteen_TwoTwoBull = fifteen_twoup and fifteen_twodown[1]; def fifteen_ThreeBull = fifteen_outsidebarup and (fifteen_twodown[1] or fifteen_insidebar[1] or fifteen_outsidebardown[1]); def fifteen_ThreeOneTwoBull = fifteen_twoup and fifteen_insidebar[1] and fifteen_outsidebardown[2]; # Bearish def fifteen_TwoOneTwoBear = fifteen_twodown and fifteen_insidebar[1] and fifteen_twoup[2]; def fifteen_TwoTwoBear = fifteen_twodown and fifteen_twoup[1]; def fifteen_ThreeBear = fifteen_outsidebardown and (fifteen_twoup[1] or fifteen_insidebar[1] or fifteen_outsidebarup[1]); def fifteen_ThreeOneTwoBear = fifteen_twodown and fifteen_insidebar[1] and fifteen_outsidebarup[2]; AddLabel(!IsNaN(fifteenO), ( (if fifteen_twoup2 then “2U” else if fifteen_twodown2 then “2D” else if fifteen_insidebarup2 then “1U" else if fifteen_insidebardown2 then “1D” else if fifteen_outsidebarup2 then “3U” else if fifteen_outsidebardown2 then “3D” else if fifteen_insidebar2 and !fifteen_insidebarup2 and !fifteen_insidebardown2 then "1" else if fifteen_outsidebar2 and !fifteen_outsidebarup2 and !fifteen_outsidebardown2 then "3" else "") + “-“ + (if fifteen_twoup1 then “2U” else if fifteen_twodown1 then “2D” else if fifteen_insidebarup1 then “1U" else if fifteen_insidebardown1 then “1D” else if fifteen_outsidebarup1 then “3U” else if fifteen_outsidebardown1 then “3D” else if fifteen_insidebar1 and !fifteen_insidebarup1 and !fifteen_insidebardown1 then "1" else if fifteen_outsidebar1 and !fifteen_outsidebarup1 and !fifteen_outsidebardown1 then "3" else "") + “-“ + (if fifteen_twoup then “[2U]” else if fifteen_twodown then “[2D]” else if fifteen_insidebarup then “[1U]" else if fifteen_insidebardown then “[1D]” else if fifteen_outsidebarup then “[3U]” else if fifteen_outsidebardown then “[3D]” else if fifteen_insidebar and !fifteen_insidebarup and !fifteen_insidebardown then "[1]" else if fifteen_outsidebar and !fifteen_outsidebarup and !fifteen_outsidebardown then "[3]" else "") + “ 15 min" + “ “ ), if fifteen_TwoOneTwoBull or fifteen_TwoTwoBull or fifteen_ThreeBull or fifteen_ThreeOneTwoBull then color.cyan else if fifteen_TwoOneTwoBear or fifteen_TwoTwoBear or fifteen_ThreeBear or fifteen_ThreeOneTwoBear then color.magenta else if !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_twoup then GlobalColor("2U”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_twodown then GlobalColor("2D”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_outsidebarup then GlobalColor("3U”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_insidebarup then GlobalColor("1U”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_outsidebardown then GlobalColor("3D”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and fifteen_insidebardown then GlobalColor("1D”) else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and !fifteen_insidebarup and !fifteen_insidebardown and fifteen_insidebar then color.white else if !fifteen_TwoOneTwoBull and !fifteen_TwoTwoBull and !fifteen_ThreeBull and !fifteen_ThreeOneTwoBull and !fifteen_TwoOneTwoBear and !fifteen_TwoTwoBear and !fifteen_ThreeBear and !fifteen_ThreeOneTwoBear and !fifteen_outsidebardown and !fifteen_outsidebarup and fifteen_outsidebar then color.white else color.current); # ----------------------------------- # Thirty Label # ----------------------------------- def thirty = AggregationPeriod.thirty_min; def Vthirty = GetAggregationPeriod() <= AggregationPeriod.thirty_min; def thirtyO; def thirtyC; def thirtyH; def thirtyL; def thirtyO1; def thirtyC1; def thirtyH1; def thirtyL1; def thirtyO2; def thirtyC2; def thirtyH2; def thirtyL2; if Vthirty { thirtyO = open(period = thirty); thirtyC = close(period = thirty); thirtyH = high(period = thirty); thirtyL = low(period = thirty); thirtyO1 = open(period = thirty)[1]; thirtyC1 = close(period = thirty)[1]; thirtyH1 = high(period = thirty)[1]; thirtyL1 = low(period = thirty)[1]; thirtyO2 = open(period = thirty)[2]; thirtyC2 = close(period = thirty)[2]; thirtyH2 = high(period = thirty)[2]; thirtyL2 = low(period = thirty)[2]; } else { thirtyO = Double.NaN; thirtyC = Double.NaN; thirtyH = Double.NaN; thirtyL = Double.NaN; thirtyO1 = Double.NaN; thirtyC1 = Double.NaN; thirtyH1 = Double.NaN; thirtyL1 = Double.NaN; thirtyO2 = Double.NaN; thirtyC2 = Double.NaN; thirtyH2 = Double.NaN; thirtyL2 = Double.NaN; } #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def thirty_insidebar = (thirtyH < thirtyH[1] and thirtyL > thirtyL[1]) or (thirtyH == thirtyH[1] and thirtyL > thirtyL[1]) or (thirtyH < thirtyH[1] and thirtyL == thirtyL[1]) or (thirtyH == thirtyH[1] and thirtyL == thirtyL[1]); def thirty_outsidebar = thirtyH > thirtyH[1] and thirtyL < thirtyL[1]; def thirty_insidebarup = thirty_insidebar and thirtyO < thirtyC; def thirty_twoup = thirtyH > thirtyH[1] and thirtyL >= thirtyL[1]; def thirty_outsidebarup = thirty_outsidebar and thirtyO < thirtyC; def thirty_insidebardown = thirty_insidebar and thirtyO > thirtyC; def thirty_twodown = thirtyH <= thirtyH[1] and thirtyL < thirtyL[1]; def thirty_outsidebardown = thirty_outsidebar and thirtyO > thirtyC; def thirty_insidebar1 = (thirtyH1 < thirtyH1[1] and thirtyL1 > thirtyL1[1]) or (thirtyH1 == thirtyH1[1] and thirtyL1 > thirtyL1[1]) or (thirtyH1 < thirtyH1[1] and thirtyL1 == thirtyL1[1]) or (thirtyH1 == thirtyH1[1] and thirtyL1 == thirtyL1[1]); def thirty_outsidebar1 = thirtyH1 > thirtyH1[1] and thirtyL1 < thirtyL[11]; def thirty_insidebarup1 = thirty_insidebar1 and thirtyO1 < thirtyC1; def thirty_twoup1 = thirtyH1 > thirtyH1[1] and thirtyL1 >= thirtyL1[1]; def thirty_outsidebarup1 = thirty_outsidebar1 and thirtyO1 < thirtyC1; def thirty_insidebardown1 = thirty_insidebar1 and thirtyO1 > thirtyC1; def thirty_twodown1 = thirtyH1 <= thirtyH1[1] and thirtyL1 < thirtyL1[1]; def thirty_outsidebardown1 = thirty_outsidebar1 and thirtyO1 > thirtyC1; def thirty_insidebar2 = (thirtyH2 < thirtyH2[1] and thirtyL2 > thirtyL2[1]) or (thirtyH2 == thirtyH2[1] and thirtyL2 > thirtyL2[1]) or (thirtyH2 < thirtyH2[1] and thirtyL2 == thirtyL2[1]) or (thirtyH2 == thirtyH2[1] and thirtyL2 == thirtyL2[1]); def thirty_outsidebar2 = thirtyH2 > thirtyH2[1] and thirtyL2 < thirtyL2[1]; def thirty_insidebarup2 = thirty_insidebar2 and thirtyO2 < thirtyC2; def thirty_twoup2 = thirtyH2 > thirtyH2[1] and thirtyL2 >= thirtyL2[1]; def thirty_outsidebarup2 = thirty_outsidebar2 and thirtyO2 < thirtyC2; def thirty_insidebardown2 = thirty_insidebar2 and thirtyO2 > thirtyC2; def thirty_twodown2 = thirtyH2 <= thirtyH2[1] and thirtyL2 < thirtyL2[1]; def thirty_outsidebardown2 = thirty_outsidebar2 and thirtyO2 > thirtyC2; #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def thirty_TwoOneTwoBull = thirty_twoup and thirty_insidebar[1] and thirty_twodown[2]; def thirty_TwoTwoBull = thirty_twoup and thirty_twodown[1]; def thirty_ThreeBull = thirty_outsidebarup and (thirty_twodown[1] or thirty_insidebar[1] or thirty_outsidebardown[1]); def thirty_ThreeOneTwoBull = thirty_twoup and thirty_insidebar[1] and thirty_outsidebardown[2]; # Bearish def thirty_TwoOneTwoBear = thirty_twodown and thirty_insidebar[1] and thirty_twoup[2]; def thirty_TwoTwoBear = thirty_twodown and thirty_twoup[1]; def thirty_ThreeBear = thirty_outsidebardown and (thirty_twoup[1] or thirty_insidebar[1] or thirty_outsidebarup[1]); def thirty_ThreeOneTwoBear = thirty_twodown and thirty_insidebar[1] and thirty_outsidebarup[2]; AddLabel(!IsNaN(thirtyO), ( (if thirty_twoup2 then “2U” else if thirty_twodown2 then “2D” else if thirty_insidebarup2 then “1U" else if thirty_insidebardown2 then “1D” else if thirty_outsidebarup2 then “3U” else if thirty_outsidebardown2 then “3D” else if thirty_insidebar2 and !thirty_insidebarup2 and !thirty_insidebardown2 then "1" else if thirty_outsidebar2 and !thirty_outsidebarup2 and !thirty_outsidebardown2 then "3" else "") + “-“ + (if thirty_twoup1 then “2U” else if thirty_twodown1 then “2D” else if thirty_insidebarup1 then “1U" else if thirty_insidebardown1 then “1D” else if thirty_outsidebarup1 then “3U” else if thirty_outsidebardown1 then “3D” else if thirty_insidebar1 and !thirty_insidebarup1 and !thirty_insidebardown1 then "1" else if thirty_outsidebar1 and !thirty_outsidebarup1 and !thirty_outsidebardown1 then "3" else "") + “-“ + (if thirty_twoup then “[2U]” else if thirty_twodown then “[2D]” else if thirty_insidebarup then “[1U]" else if thirty_insidebardown then “[1D]” else if thirty_outsidebarup then “[3U]” else if thirty_outsidebardown then “[3D]” else if thirty_insidebar and !thirty_insidebarup and !thirty_insidebardown then "[1]" else if thirty_outsidebar and !thirty_outsidebarup and !thirty_outsidebardown then "[3]" else "") + “ 30 min" + “ “ ), if thirty_TwoOneTwoBull or thirty_TwoTwoBull or thirty_ThreeBull or thirty_ThreeOneTwoBull then color.cyan else if thirty_TwoOneTwoBear or thirty_TwoTwoBear or thirty_ThreeBear or thirty_ThreeOneTwoBear then color.magenta else if !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_twoup then GlobalColor("2U”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_twodown then GlobalColor("2D”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_outsidebarup then GlobalColor("3U”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_insidebarup then GlobalColor("1U”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_outsidebardown then GlobalColor("3D”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and thirty_insidebardown then GlobalColor("1D”) else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and !thirty_insidebarup and !thirty_insidebardown and thirty_insidebar then color.white else if !thirty_TwoOneTwoBull and !thirty_TwoTwoBull and !thirty_ThreeBull and !thirty_ThreeOneTwoBull and !thirty_TwoOneTwoBear and !thirty_TwoTwoBear and !thirty_ThreeBear and !thirty_ThreeOneTwoBear and !thirty_outsidebardown and !thirty_outsidebarup and thirty_outsidebar then color.white else color.current); # ----------------------------------- # Hour Label # ----------------------------------- def hour = AggregationPeriod.hour; def Vhour = GetAggregationPeriod() <= AggregationPeriod.hour; def hourO; def hourC; def hourH; def hourL; def hourO1; def hourC1; def hourH1; def hourL1; def hourO2; def hourC2; def hourH2; def hourL2; if Vhour { hourO = open(period = hour); hourC = close(period = hour); hourH = high(period = hour); hourL = low(period = hour); hourO1 = open(period = hour)[1]; hourC1 = close(period = hour)[1]; hourH1 = high(period = hour)[1]; hourL1 = low(period = hour)[1]; hourO2 = open(period = hour)[2]; hourC2 = close(period = hour)[2]; hourH2 = high(period = hour)[2]; hourL2 = low(period = hour)[2]; } else { hourO = Double.NaN; hourC = Double.NaN; hourH = Double.NaN; hourL = Double.NaN; hourO1 = Double.NaN; hourC1 = Double.NaN; hourH1 = Double.NaN; hourL1 = Double.NaN; hourO2 = Double.NaN; hourC2 = Double.NaN; hourH2 = Double.NaN; hourL2 = Double.NaN; } #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def hour_insidebar = (hourH < hourH[1] and hourL > hourL[1]) or (hourH == hourH[1] and hourL > hourL[1]) or (hourH < hourH[1] and hourL == hourL[1]) or (hourH == hourH[1] and hourL == hourL[1]); def hour_outsidebar = hourH > hourH[1] and hourL < hourL[1]; def hour_insidebarup = hour_insidebar and hourO < hourC; def hour_twoup = hourH > hourH[1] and hourL >= hourL[1]; def hour_outsidebarup = hour_outsidebar and hourO < hourC; def hour_insidebardown = hour_insidebar and hourO > hourC; def hour_twodown = hourH <= hourH[1] and hourL < hourL[1]; def hour_outsidebardown = hour_outsidebar and hourO > hourC; def hour_insidebar1 = (hourH1 < hourH1[1] and hourL1 > hourL1[1]) or (hourH1 == hourH1[1] and hourL1 > hourL1[1]) or (hourH1 < hourH1[1] and hourL1 == hourL1[1]) or (hourH1 == hourH1[1] and hourL1 == hourL1[1]); def hour_outsidebar1 = hourH1 > hourH1[1] and hourL1 < hourL[11]; def hour_insidebarup1 = hour_insidebar1 and hourO1 < hourC1; def hour_twoup1 = hourH1 > hourH1[1] and hourL1 >= hourL1[1]; def hour_outsidebarup1 = hour_outsidebar1 and hourO1 < hourC1; def hour_insidebardown1 = hour_insidebar1 and hourO1 > hourC1; def hour_twodown1 = hourH1 <= hourH1[1] and hourL1 < hourL1[1]; def hour_outsidebardown1 = hour_outsidebar1 and hourO1 > hourC1; def hour_insidebar2 = (hourH2 < hourH2[1] and hourL2 > hourL2[1]) or (hourH2 == hourH2[1] and hourL2 > hourL2[1]) or (hourH2 < hourH2[1] and hourL2 == hourL2[1]) or (hourH2 == hourH2[1] and hourL2 == hourL2[1]); def hour_outsidebar2 = hourH2 > hourH2[1] and hourL2 < hourL2[1]; def hour_insidebarup2 = hour_insidebar2 and hourO2 < hourC2; def hour_twoup2 = hourH2 > hourH2[1] and hourL2 >= hourL2[1]; def hour_outsidebarup2 = hour_outsidebar2 and hourO2 < hourC2; def hour_insidebardown2 = hour_insidebar2 and hourO2 > hourC2; def hour_twodown2 = hourH2 <= hourH2[1] and hourL2 < hourL2[1]; def hour_outsidebardown2 = hour_outsidebar2 and hourO2 > hourC2; #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def hour_TwoOneTwoBull = hour_twoup and hour_insidebar[1] and hour_twodown[2]; def hour_TwoTwoBull = hour_twoup and hour_twodown[1]; def hour_ThreeBull = hour_outsidebarup and (hour_twodown[1] or hour_insidebar[1] or hour_outsidebardown[1]); def hour_ThreeOneTwoBull = hour_twoup and hour_insidebar[1] and hour_outsidebardown[2]; # Bearish def hour_TwoOneTwoBear = hour_twodown and hour_insidebar[1] and hour_twoup[2]; def hour_TwoTwoBear = hour_twodown and hour_twoup[1]; def hour_ThreeBear = hour_outsidebardown and (hour_twoup[1] or hour_insidebar[1] or hour_outsidebarup[1]); def hour_ThreeOneTwoBear = hour_twodown and hour_insidebar[1] and hour_outsidebarup[2]; AddLabel(!IsNaN(hourO), ( (if hour_twoup2 then “2U” else if hour_twodown2 then “2D” else if hour_insidebarup2 then “1U" else if hour_insidebardown2 then “1D” else if hour_outsidebarup2 then “3U” else if hour_outsidebardown2 then “3D” else if hour_insidebar2 and !hour_insidebarup2 and !hour_insidebardown2 then "1" else if hour_outsidebar2 and !hour_outsidebarup2 and !hour_outsidebardown2 then "3" else "") + “-“ + (if hour_twoup1 then “2U” else if hour_twodown1 then “2D” else if hour_insidebarup1 then “1U" else if hour_insidebardown1 then “1D” else if hour_outsidebarup1 then “3U” else if hour_outsidebardown1 then “3D” else if hour_insidebar1 and !hour_insidebarup1 and !hour_insidebardown1 then "1" else if hour_outsidebar1 and !hour_outsidebarup1 and !hour_outsidebardown1 then "3" else "") + “-“ + (if hour_twoup then “[2U]” else if hour_twodown then “[2D]” else if hour_insidebarup then “[1U]" else if hour_insidebardown then “[1D]” else if hour_outsidebarup then “[3U]” else if hour_outsidebardown then “[3D]” else if hour_insidebar and !hour_insidebarup and !hour_insidebardown then "[1]" else if hour_outsidebar and !hour_outsidebarup and !hour_outsidebardown then "[3]" else "") + “ 60 min " + “ “ ), if hour_TwoOneTwoBull or hour_TwoTwoBull or hour_ThreeBull or hour_ThreeOneTwoBull then color.cyan else if hour_TwoOneTwoBear or hour_TwoTwoBear or hour_ThreeBear or hour_ThreeOneTwoBear then color.magenta else if !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_twoup then GlobalColor("2U”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_twodown then GlobalColor("2D”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_outsidebarup then GlobalColor("3U”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_insidebarup then GlobalColor("1U”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_outsidebardown then GlobalColor("3D”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and hour_insidebardown then GlobalColor("1D”) else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and !hour_insidebarup and !hour_insidebardown and hour_insidebar then color.white else if !hour_TwoOneTwoBull and !hour_TwoTwoBull and !hour_ThreeBull and !hour_ThreeOneTwoBull and !hour_TwoOneTwoBear and !hour_TwoTwoBear and !hour_ThreeBear and !hour_ThreeOneTwoBear and !hour_outsidebardown and !hour_outsidebarup and hour_outsidebar then color.white else color.current);
NEW_STRAT_MTF_LABEL_w_REVERSALS-FULL
https://tos.mx/l437rHI
PLEASE BE AWARE THAT THESE STUDIES CONTAIN PAGES AND PAGES OF CODE AND THEY WILL TAKE A VERY LONG TIME TO LOAD ON AN OLDER MACHINE. THEY COULD ALSO SLOW DOWN YOUR PERFORMANCE.
Here's what they look like:
NEW WATCHLIST COLUMN.
Here's a video tutorial for how to set it up:
Code:#------------------------------------ # # M T F S T R A T # W A T C H L I S T # a Study by Ramon DV. aka Pelonsax # #------------------------------------ #------------------------------------ # S T R A T R E V E R S A L S # # A study by Ramon DV. aka Pelonsax # # Version 1.0 8/01/20 # # Version 2.0 8/4/20 Corrected errors in logic for scenarios # Version 2.1 8/15/20 Added Reversals # 9/15/20 added two previous bars and reversals for WL columns # #------------------------------------ def H = high; def L = low; def O = open; def C = close; #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]); def outsidebar = H > H[1] and L < L[1]; def insidebarup = insidebar and O < C; def twoup = H > H[1] and L >= L[1]; def outsidebarup = outsidebar and O < C; def insidebardown = insidebar and O > C; def twodown = H <= H[1] and L < L[1]; def outsidebardown = outsidebar and O > C; def insidebar1 = (H[1] < H[2] and L[1] > L[2]) or (H[1] == H[2] and L[1] > L[2]) or (H[1] < H[2] and L[1] == L[2]) or (H[1] == H[2] and L[1] == L[2]); def outsidebar1 = H[1] > H[2] and L[1] < L[2]; def insidebarup1 = insidebar1 and O[1] < C[1]; def twoup1 = H[1] > H[2] and L[1] >= L[2]; def outsidebarup1 = outsidebar1 and O[1] < C[1]; def insidebardown1 = insidebar1 and O[1] > C[1]; def twodown1 = H[1] <= H[2] and L[1] < L[2]; def outsidebardown1 = outsidebar1 and O[1] > C[1]; def insidebar2 = (H[2] < H[3] and L[2] > L[3]) or (H[2] == H[3] and L[2] > L[3]) or (H[2] < H[3] and L[2] == L[3]) or (H[2] == H[3] and L[2] == L[3]); def outsidebar2 = H[2] > H[3] and L[2] < L[3]; def insidebarup2 = insidebar2 and O[2] < C[2]; def twoup2 = H[2] > H[3] and L[2] >= L[3]; def outsidebarup2 = outsidebar2 and O[2] < C[2]; def insidebardown2 = insidebar2 and O[2] > C[2]; def twodown2 = H[2] <= H[3] and L[2] < L[3]; def outsidebardown2 = outsidebar2 and O[2] > C[2]; #------------------------------------ # DEFINE REVERSALS (Basic four) #------------------------------------ # Bullish def TwoOneTwoBull = twoup and insidebar1 and twodown2; def TwoTwoBull = twoup and twodown1; def ThreeBull = outsidebarup and (twodown1 or insidebar1 or outsidebardown1); def ThreeOneTwoBull = twoup and insidebar1 and outsidebardown2; # Bearish def TwoOneTwoBear = twodown and insidebar1 and twoup2; def TwoTwoBear = twodown and twoup2; def ThreeBear = outsidebardown and (twoup1 or insidebar1 or outsidebarup1); def ThreeOneTwoBear = twodown and insidebar1 and outsidebarup2; #------------------------------------ # LABEL SECTION #------------------------------------ AddLabel(yes, (if twoup2 then “2U” else if twodown2 then “2D” else if insidebarup2 then “1U" else if insidebardown2 then “1D” else if outsidebarup2 then “3U” else if outsidebardown2 then “3D” else if insidebar2 and !insidebarup2 and !insidebardown2 then "1" else if outsidebar2 and !outsidebarup2 and !outsidebardown2 then "3" else “”) + “-“ + (if twoup1 then “2U” else if twodown1 then “2D” else if insidebarup1 then “1U" else if insidebardown1 then “1D” else if outsidebarup1 then “3U” else if outsidebardown1 then “3D” else if insidebar1 and !insidebarup1 and !insidebardown1 then "1" else if outsidebar1 and !outsidebarup1 and !outsidebardown1 then "3" else “”)+ ”-“ + (if twoup then “[2U]” else if twodown then “[2D]” else if insidebarup then “[1U]” else if insidebardown then “[1D]” else if outsidebarup then “[3U]” else if outsidebardown then “[3D]” else if insidebar and !insidebarup and !insidebardown then “[1]” else if outsidebar and !outsidebarup and !outsidebardown then “[3]” else “”), color.black); assignbackgroundColor(if TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull then color.cyan else if TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear then color.magenta else if !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and twoup then color.green else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and twodown then color.red else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and outsidebarup then color.dark_green else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and insidebarup then color.light_green else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and outsidebardown then color.dark_red else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and insidebardown then color.orange else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and !insidebarup and !insidebardown and insidebar then color.white else if !TwoOneTwoBull and !TwoTwoBull and !ThreeBull and !ThreeOneTwoBull and !TwoOneTwoBear and !TwoTwoBear and !ThreeBear and !ThreeOneTwoBear and !outsidebardown and !outsidebarup and outsidebar then color.white else color.current);
Here's what how they appear:
Here is a consolidated version of an MTF Time Frame Continuity Study I have previously released.
This version will negate the need to add a different label for each time frame. Just load the one study. I have it set to show up on a lower window just to free up space, but you can easily drag it up to the price window if you prefer. On this study, you will see the time frame, the level it opened at and green/red/white depending on whether price is currently above/below/ equal to the open on that time frame.
STRAT_TFC_MTF_LABELS
https://tos.mx/Pv3UmFi
!! NEW FULL TIME FRAME CONTINUITY STUDY !!
THIS STUDY HAS BEEN INCORPORATED INTO THE TIME FRAME CONTINUITY STUDY AT THE TOP
This study determines the highest and lowest open among time frames. I have two versions of it, Intraday and Full. The intraday version considers the following time frames: 1 minute, 5 minute, 15 minute, 30 minute, 1 hour. Because of the way it is coded, at this time it is not functional on anything but a 1 minute chart. If you look at the code you will see how simple it is to modify it so that it can work on a five or three minute or whatever you choose. The Full version considers the 1 hour, 1 day, 1 week and 1 month time frames. I call them STRAT_opens_Intrday and STRAT_Opens_Full respectively. There are gray arrows that appear whenever there is full time frame continuity in either direction and the cyan and magenta lines indicate the beginning of full time frame continuity in either direction.
OPEN LINES ON ALL TIME FRAMES STUDY:
I coded up an indicator for TOS that shows the open lines of all time frames. You can load it on any chart, any time frame, and it will show the time frame of the chart and higher (but not lower. TOS doesn't show MTF scripts for lower time frames.) The time frames that are available are 5m, 15m, 30m, 60, D, W, M, Y. This just draws a line and a bubble at the open for each time frame. Helps to see TFC.
STRAT_Open_Lines
https://tos.mx/XwL9MlX
Here's the code:
Code:#------------------------------- # # S T R A T O P E N S # # a study that indicates the opens # on mutliple time frames # for full time frame continuity INTRADAY # and FULL. All in one. # Author: Ramon DV aka Pelonsax # #-------------------------------- declare upper; # ----------------------------------- # 5 Minute Line # ----------------------------------- def "5mAGG" = AggregationPeriod.FIVE_MIN; def Vfive = GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN; def five; if Vfive { five = open(period = "5mAGG"); } else { five = Double.NaN; } plot fiveO = HighestAll(if IsNaN(five[-1]) and !IsNaN(five) then five else Double.NaN); fiveO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); fiveO.SetDefaultColor(Color.CYAN); def SR5 = !IsNaN(five) and IsNaN(five [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR5, fiveO, "5 min", Color.CYAN, yes); # ----------------------------------- # 15 Minute Line # ----------------------------------- def "15mAGG" = AggregationPeriod.FIFTEEN_MIN; def Vfifteen = GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN; def fifteen; if Vfifteen { fifteen = open(period = "15mAGG"); } else { fifteen = Double.NaN; } plot fifteenO = HighestAll(if IsNaN(fifteen[-1]) and !IsNaN(fifteen) then fifteen else Double.NaN); fifteenO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); fifteenO.SetDefaultColor(Color.CYAN); def SR15 = !IsNaN(fifteen) and IsNaN(fifteen [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR15, fifteenO, "15 min", Color.CYAN, yes); # ----------------------------------- # 30 Minute Line # ----------------------------------- def "30mAGG" = AggregationPeriod.THIRTY_MIN; def Vthirty = GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN; def thirty; if Vthirty { thirty = open(period = "30mAGG"); } else { thirty = Double.NaN; } plot thirtyO = HighestAll(if IsNaN(thirty[-1]) and !IsNaN(thirty) then thirty else Double.NaN); thirtyO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); thirtyO.SetDefaultColor(Color.CYAN); def SR30 = !IsNaN(thirty) and IsNaN(thirty [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR30, thirtyO, "30 min", Color.CYAN, yes); # ----------------------------------- # 60 Minute Line # ----------------------------------- def "60mAGG" = AggregationPeriod.HOUR; def Vhour = GetAggregationPeriod() <= AggregationPeriod.HOUR; def hour; if Vhour { hour = open(period = "60mAGG"); } else { hour = Double.NaN; } plot hourO = HighestAll(if IsNaN(hour[-1]) and !IsNaN(hour) then hour else Double.NaN); hourO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); hourO.SetDefaultColor(Color.CYAN); def SR60 = !IsNaN(hour) and IsNaN(hour [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR60, hourO, "60 min", Color.CYAN, yes); # ----------------------------------- # Day Line # ----------------------------------- def "1DAGG" = AggregationPeriod.DAY; def Vday = GetAggregationPeriod() <= AggregationPeriod.DAY; def day; if Vday { day = open(period = "1DAGG"); } else { day = Double.NaN; } plot dayO = HighestAll(if IsNaN(day[-1]) and !IsNaN(day) then day else Double.NaN); dayO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); dayO.SetDefaultColor(Color.CYAN); def SR1D = !IsNaN(day) and IsNaN(day [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1D, dayO, "Day", Color.CYAN, yes); # ----------------------------------- # Week Line # ----------------------------------- def "1wAGG" = AggregationPeriod.WEEK; def Vweek = GetAggregationPeriod() <= AggregationPeriod.WEEK; def week; if Vweek { week = open(period = "1wAGG"); } else { week = Double.NaN; } plot weekO = HighestAll(if IsNaN(week[-1]) and !IsNaN(week) then week else Double.NaN); weekO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); weekO.SetDefaultColor(Color.CYAN); def SR1W = !IsNaN(week) and IsNaN(week [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1W, weekO, "Week", Color.CYAN, yes); # ----------------------------------- # Month Line # ----------------------------------- def "1MOAGG" = AggregationPeriod.MONTH; def Vmonth = GetAggregationPeriod() <= AggregationPeriod.MONTH; def month; if Vmonth { month = open(period = "1MOAGG"); } else { month = Double.NaN; } plot monthO = HighestAll(if IsNaN(month[-1]) and !IsNaN(month) then month else Double.NaN); monthO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); monthO.SetDefaultColor(Color.CYAN); def SR1MO = !IsNaN(month) and IsNaN(month [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1MO, monthO, "Month", Color.CYAN, yes); # ----------------------------------- # Year Line # ----------------------------------- def "1YAGG" = AggregationPeriod.YEAR; def Vyear = GetAggregationPeriod() <= AggregationPeriod.YEAR; def year; if Vyear { year = open(period = "1YAGG"); } else { year = Double.NaN; } plot yearO = HighestAll(if IsNaN(year[-1]) and !IsNaN(year) then year else Double.NaN); yearO.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); yearO.SetDefaultColor(Color.CYAN); def SR1Y = !IsNaN(year) and IsNaN(year [-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1Y, yearO, "Year", Color.CYAN, yes);
Here's what they look like:
BETTER VERSION OF PREVIOUS STUDY
I have made a different version of the MTF Open level study I published a few days ago. This one draws the line out to the right only instead of all the way across the screen and it paints the bubble green/red/white to show if price is above/below/equal to each time frame. It also has a function that allows the user to offset the bubble to the right. (In the settings menu). I am not going to take down the other post with the first of these studies because I still want to test this one to make sure it is in fact doing exactly what it is supposed to. I used a bit of code from Mobius in this one and I'm not 100% sure I got the adaptation correct, so feel free to use it and let me know if you notice anything awry. I don't think you will (I haven't found anything), but be aware that this is a beta study at this point.
MTF_Open_Levels:
https://tos.mx/EOoi51t
Code:#------------------------------- # # S T R A T O P E N S # # a study that indicates the opens # on mutliple time frames # for full time frame continuity INTRADAY # and FULL. All in one. # Author: Ramon DV aka Pelonsax # With help from Mobius #-------------------------------- declare upper; input Bubble_Offset = 5; #-------------------------------- #-------------------------------- # Internal Script Reference # created by Mobius #-------------------------------- script LinePlot { input BarID = 0; input Value = 0; input BarOrigin = 0; def ThisBar = HighestAll(BarOrigin); def ValueLine = if BarOrigin == ThisBar then Value else Double.NaN; plot P = if ThisBar - BarID <= BarOrigin then HighestAll(ValueLine) else Double.NaN; } def x = BarNumber(); # ----------------------------------- # 5 Minute Line # ----------------------------------- def "5mAGG" = AggregationPeriod.FIVE_MIN; def Vfive = GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN; def five; def fiveC; if Vfive { five = open(period = "5mAGG"); fiveC = close(period = "5mAGG"); } else { five = Double.NaN; fiveC = Double.NaN; } def FiveValue = if !IsNaN(five) then five else FiveValue[1]; def FiveBarOrigin = if !IsNaN(five) then x else FiveBarOrigin[1]; def FiveBarID = x - FiveBarOrigin; plot fiveL = LinePlot(BarID = FiveBarID, Value = FiveValue, BarOrigin = FiveBarOrigin); fiveL.SetDefaultColor(color.LIGHT_GRAY); def SR5 = !IsNaN(five[Bubble_Offset]) and IsNaN(five[Bubble_Offset-1]) and HighestAll(BarNumber()); AddChartBubble (SR5, fiveL, “5 min", (if five[Bubble_Offset] < fiveC[Bubble_Offset] then Color.GREEN else if five[Bubble_Offset] > fiveC[Bubble_Offset] then color.RED else if five[Bubble_Offset] == fiveC[Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # 15 Minute Line # ----------------------------------- def "15mAGG" = AggregationPeriod.FIFTEEN_MIN; def Vfifteen = GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN; def fifteen; def fifteenC; if Vfifteen { fifteen = open(period = "15mAGG"); fifteenC = close(period = "15mAGG"); } else { fifteen = Double.NaN; fifteenC = Double.NaN; } def FifteenValue = if !IsNaN(fifteen) then fifteen else FifteenValue[1]; def FifteenBarOrigin = if !IsNaN(fifteen) then x else FifteenBarOrigin[1]; def FifteenBarID = x - FifteenBarOrigin; plot fifteenL = LinePlot(BarID = FifteenBarID, Value = FifteenValue, BarOrigin = FifteenBarOrigin); fifteenL.SetDefaultColor(color.LIGHT_GRAY); def SR15 = !IsNaN(fifteen[10+Bubble_Offset]) and IsNaN(fifteen[10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR15, fifteenL, “15 min", (if fifteen[10+Bubble_Offset] < fifteenC[10+Bubble_Offset] then Color.GREEN else if fifteen[10+Bubble_Offset] > fifteenC[10+Bubble_Offset] then color.RED else if fifteen[10+Bubble_Offset] == fifteenC[10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # 30 Minute Line # ----------------------------------- def "30mAGG" = AggregationPeriod.THIRTY_MIN; def Vthirty = GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN; def thirty; def thirtyC; if Vthirty { thirty = open(period = "30mAGG"); thirtyC = close(period = "30mAGG"); } else { thirty = Double.NaN; thirtyC = Double.NaN; } def ThirtyValue = if !IsNaN(thirty) then thirty else ThirtyValue[1]; def ThirtyBarOrigin = if !IsNaN(thirty) then x else ThirtyBarOrigin[1]; def ThirtyBarID = x - ThirtyBarOrigin; plot thirtyL = LinePlot(BarID = ThirtyBarID, Value = ThirtyValue, BarOrigin = ThirtyBarOrigin); thirtyL.SetDefaultColor(color.LIGHT_GRAY); def SR30 = !IsNaN(thirty[10+10+Bubble_Offset]) and IsNaN(thirty[10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR30, thirtyL, “30 min", (if thirty[10+10+Bubble_Offset] < thirtyC[10+10+Bubble_Offset] then Color.GREEN else if thirty[10+10+Bubble_Offset] > thirtyC[10+10+Bubble_Offset] then color.RED else if thirty[10+10+Bubble_Offset] == thirtyC[10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # 60 Minute Line # ----------------------------------- def "60mAGG" = AggregationPeriod.HOUR; def Vhour = GetAggregationPeriod() <= AggregationPeriod.HOUR; def hour; def hourC; if Vhour { hour = open(period = "60mAGG"); hourC = close(period = "60mAGG"); } else { hour = Double.NaN; hourC = Double.NaN; } def HourValue = if !IsNaN(hour) then hour else HourValue[1]; def HourBarOrigin = if !IsNaN(hour) then x else HourBarOrigin[1]; def HourBarID = x - HourBarOrigin; plot hourL = LinePlot(BarID = HourBarID, Value = HourValue, BarOrigin = HourBarOrigin); hourL.SetDefaultColor(color.LIGHT_GRAY); def SR60 = !IsNaN(hour[10+10+10+Bubble_Offset]) and IsNaN(hour[10+10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR60, hourL, “60 min",(if hour[10+10+10+Bubble_Offset] < hourC[10+10+10+Bubble_Offset] then Color.GREEN else if hour[10+10+10+Bubble_Offset] > hourC[10+10+10+Bubble_Offset] then color.RED else if hour[10+10+10+Bubble_Offset] == hourC[10+10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # Day Line # ----------------------------------- def "1DAGG" = AggregationPeriod.DAY; def Vday = GetAggregationPeriod() <= AggregationPeriod.DAY; def day; def dayC; if Vday { day = open(period = "1DAGG"); dayC = close(period = "1DAGG"); } else { day = Double.NaN; dayC = Double.NaN; } def DayValue = if !IsNaN(day) then day else DayValue[1]; def DayBarOrigin = if !IsNaN(day) then x else DayBarOrigin[1]; def DayBarID = x - DayBarOrigin; plot dayL = LinePlot(BarID = DayBarID, Value = DayValue, BarOrigin = DayBarOrigin); dayL.SetDefaultColor(color.LIGHT_GRAY); def SR1D = !IsNaN(day[10+10+10+10+Bubble_Offset]) and IsNaN(day[10+10+10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1D, dayL, “Day", (if day[20+10+10+10+10+Bubble_Offset] < dayC[10+10+10+10+Bubble_Offset] then Color.GREEN else if day[10+10+10+10+Bubble_Offset] > dayC[10+10+10+10+Bubble_Offset] then color.RED else if day[10+10+10+10+Bubble_Offset] == dayC[10+10+10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # Week Line # ----------------------------------- def "1WAGG" = AggregationPeriod.WEEK; def Vweek = GetAggregationPeriod() <= AggregationPeriod.WEEK; def week; def weekC; if Vweek { week = open(period = "1WAGG"); weekC = close(period = "1WAGG"); } else { week = Double.NaN; weekC = Double.NaN; } def WeekValue = if !IsNaN(week) then week else WeekValue[1]; def WeekBarOrigin = if !IsNaN(week) then x else WeekBarOrigin[1]; def WeekBarID = x - WeekBarOrigin; plot weekL = LinePlot(BarID = WeekBarID, Value = WeekValue, BarOrigin = WeekBarOrigin); weekL.SetDefaultColor(color.LIGHT_GRAY); def SR1W = !IsNaN(week[10+10+10+10+10+Bubble_Offset]) and IsNaN(week[10+10+10+10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1W, weekL, “Week",(if week[10+10+10+10+10+Bubble_Offset] < weekC[10+10+10+10+10+Bubble_Offset] then Color.GREEN else if week[10+10+10+10+10+Bubble_Offset] > weekC[10+10+10+10+10+Bubble_Offset] then color.RED else if week[10+10+10+10+10+Bubble_Offset] == weekC[10+10+10+10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # Month Line # ----------------------------------- def "1MOAGG" = AggregationPeriod.MONTH; def Vmonth = GetAggregationPeriod() <= AggregationPeriod.MONTH; def month; def monthC; if Vmonth { month = open(period = "1MOAGG"); monthC = close(period = "1MOAGG"); } else { month = Double.NaN; monthC = Double.NaN; } def MonthValue = if !IsNaN(month) then month else MonthValue[1]; def MonthBarOrigin = if !IsNaN(month) then x else MonthBarOrigin[1]; def MonthBarID = x - MonthBarOrigin; plot monthL = LinePlot(BarID = MonthBarID, Value = MonthValue, BarOrigin = MonthBarOrigin); monthL.SetDefaultColor(color.LIGHT_GRAY); def SR1MO = !IsNaN(month[10+10+10+10+10+10+Bubble_Offset]) and IsNaN(month[10+10+10+10+10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1MO, monthL, “Month",(if month[10+10+10+10+10+10+Bubble_Offset] < monthC[10+10+10+10+10+10+Bubble_Offset] then Color.GREEN else if month[10+10+10+10+10+10+Bubble_Offset] > monthC[10+10+10+10+10+10+Bubble_Offset] then color.RED else if month[10+10+10+10+10+10+Bubble_Offset] == monthC[10+10+10+10+10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ----------------------------------- # Year Line # ----------------------------------- def "1YAGG" = AggregationPeriod.YEAR; def Vyear = GetAggregationPeriod() <= AggregationPeriod.YEAR; def year; def yearC; if Vyear { year = open(period = "1YAGG"); yearC = close(period = "1YAGG"); } else { year = Double.NaN; yearC = Double.NaN; } def YearValue = if !IsNaN(year) then year else YearValue[1]; def YearBarOrigin = if !IsNaN(year) then x else YearBarOrigin[1]; def YearBarID = x - YearBarOrigin; plot yearL = LinePlot(BarID = YearBarID, Value = YearValue, BarOrigin = YearBarOrigin); yearL.SetDefaultColor(color.LIGHT_GRAY); def SR1Y = !IsNaN(year[10+10+10+10+10+10+10+Bubble_Offset]) and IsNaN(year[10+10+10+10+10+10+10+Bubble_Offset-1] ) and HighestAll(BarNumber()); AddChartBubble (SR1Y, yearL, “Year", (if year[10+10+10+10+10+10+10+Bubble_Offset] < yearC[10+10+10+10+10+10+10+Bubble_Offset] then Color.GREEN else if year[10+10+10+10+10+10+10+Bubble_Offset] > yearC[10+10+10+10+10+10+10+Bubble_Offset] then color.RED else if year[10+10+10+10+10+10+10+Bubble_Offset] == yearC[10+10+10+10+10+10+10+Bubble_Offset] then color.WHITE else color.BLACK), yes); # ---- End ----
COMPLETE TIME FRAME CONTINUITY STUDY WITH BACKGROUND COLOR AND ALERTS
THIS STUDY HAS BEEN INCORPORATED INTO THE TIME FRAME CONTINUITY STUDY AT THE TOP
DO NOT LOAD THIS ON THE WHITE PRELOADED CHARTS. THEY ALREADY HAVE A VERSION THAT DOESN'T CHANGE THE BACKGROUND COLOR
This study incorporates the same elements of the previous TFC studies in one complete script. You can place this script on any chart in any time frame and it will work, but there is a catch and there is nothing anyone can do to change it: like ANY multi time frame study in tThink or Swim, this WILL NOT use the aggregations for time frames that are lower than the chart. This means that it will not draw or consider the open for a lower time frame (for example any intraday TF on a daily chart. I recommend that you use a grid with multiple time frames in order to make the best use of this study. When you place this on a chart, you must check to see how much data you are providing. For example, if you are on a 1min 1D chart, you have only two days worth of data, so you cannot use any time frame higher than a day. In order to use the week or month or year, you would need the chart to include a week, month, year's worth of time. Once you have the time frame the chart is set to and the amount of time that is on the chart, you should go into the settings and select "No" for any time frames that are not included. For example: If you use a 5 min 10 D chart, you should select "no" on Use Minute, Use Three, Use Month, Use Year. If you are only looking for intraday time frame continuity, you should select Use Minute through Use Hour. The study changes the background color of the chart when there is FTFC to the upside (green) or to the downside (red). If the background is black, there is no FTFC. It also has the highest and lowest open levels painted as cyan and magenta lines (like the previous studies) as well as arrows wherever there is FTFC. You can choose to not display only of the elements listed above with the exception of the background color. I recommend you allow the use of the lines and labels when you first place the study on the chart so that you can be sure that you are displaying time frame continuity correctly or as desired. There is also an audible alert. Here's what it looks like:
Here's the study link:
https://tos.mx/JZROQzW
Here's the code:
Code:#------------------------------- # # S T R A T O P E N S # # a study that indicates the opens # on mutliple time frames # for full time frame continuity INTRADAY # and FULL. All in one. # Author: Ramon DV aka Pelonsax # #-------------------------------- declare upper; # ----------------------------------- # INPUTS # ----------------------------------- input Use_Minute = yes; input Use_Three = yes; input Use_Five = yes; input Use_Fifteen = yes; input Use_Thirty = yes; input Use_Sixty = yes; input Use_Day = yes; input Use_Week = yes; input Use_Month = yes; input Use_Year = yes; input Show_Lines = yes; input Show_Arrows = yes; input Show_Label = yes; # ----------------------------------- # 1 Minute # ----------------------------------- def "1mAGG" = AggregationPeriod.MIN; def Vminute = GetAggregationPeriod() <= AggregationPeriod.MIN; def minute; if Use_Minute and Vminute { minute = open(period = "1mAGG"); } else { minute = open; } # ----------------------------------- # 3 Minute # ----------------------------------- def "3mAGG" = AggregationPeriod.THREE_MIN; def Vthree = GetAggregationPeriod() <= AggregationPeriod.THREE_MIN; def three; if Use_Three and Vthree { three = open(period = "3mAGG"); } else { three = open; } # ----------------------------------- # 5 Minute # ----------------------------------- def "5mAGG" = AggregationPeriod.FIVE_MIN; def Vfive = GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN; def five; if Use_Five and Vfive { five = open(period = "5mAGG"); } else { five = open; } # ----------------------------------- # 15 Minute Line # ----------------------------------- def "15mAGG" = AggregationPeriod.FIFTEEN_MIN; def Vfifteen = GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN; def fifteen; if Use_Fifteen and Vfifteen { fifteen = open(period = "15mAGG"); } else { fifteen = open; } # ----------------------------------- # 30 Minute Line # ----------------------------------- def "30mAGG" = AggregationPeriod.THIRTY_MIN; def Vthirty = GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN; def thirty; if Use_Thirty and Vthirty { thirty = open(period = "30mAGG"); } else { thirty = open; } # ----------------------------------- # 60 Minute Line # ----------------------------------- def "60mAGG" = AggregationPeriod.HOUR; def Vhour = GetAggregationPeriod() <= AggregationPeriod.HOUR; def hour; if Use_Sixty and Vhour { hour = open(period = "60mAGG"); } else { hour = open; } # ----------------------------------- # Day # ----------------------------------- def "1DAGG" = AggregationPeriod.DAY; def Vday = GetAggregationPeriod() <= AggregationPeriod.DAY; def day; if Use_Day and Vday { day = open(period = "1DAGG"); } else { day = open; } # ----------------------------------- # Week # ----------------------------------- def "1wAGG" = AggregationPeriod.WEEK; def Vweek = GetAggregationPeriod() <= AggregationPeriod.WEEK; def week; if Use_Week and Vweek { week = open(period = "1wAGG"); } else { week = open; } # ----------------------------------- # Month # ----------------------------------- def "1MOAGG" = AggregationPeriod.MONTH; def Vmonth = GetAggregationPeriod() <= AggregationPeriod.MONTH; def month; if Use_Month and Vmonth { month = open(period = "1MOAGG"); } else { month = open; } # ----------------------------------- # Year # ----------------------------------- def "1YAGG" = AggregationPeriod.YEAR; def Vyear = GetAggregationPeriod() <= AggregationPeriod.YEAR; def year; if Use_Year and Vyear { year = open(period = "1YAGG"); } else { year = open; } # ----------------------------------- # FTC COMPONENT # ----------------------------------- # TOP plot top = if minute >= three and minute >= five and minute >= fifteen and minute >= thirty and minute >= hour and minute >= day and minute >= week and minute >= month and minute >= year then minute else if three >= minute and three >= five and three >= fifteen and three >= thirty and three >= hour and three >= day and three >= week and three >= month and three >= year then three else if five >= minute and five >= three and five >= fifteen and five >= thirty and five >= hour and five >= day and five >= week and five >= month and five >= year then five else if fifteen >= minute and fifteen >= three and fifteen >= five and fifteen >= thirty and fifteen >= hour and fifteen >= day and fifteen >= week and fifteen >= month and fifteen >= year then fifteen else if thirty >= minute and thirty >= three and thirty >= five and thirty >= fifteen and thirty >= hour and thirty >= day and thirty >= week and thirty >= month and thirty >= year then thirty else if hour >= minute and hour >= three and hour >= five and hour >= fifteen and hour >= thirty and hour >= day and hour >= week and hour >= month and hour >= year then hour else if day >= minute and day >= three and day >= five and day >= fifteen and day >= thirty and day >= hour and day >= week and day >= month and day >= year then day else if week >= minute and week >= three and week >= five and week >= fifteen and week >= thirty and week >= hour and week >= day and week >= month and week >= year then week else if month >= minute and month >= three and month >= five and month >= fifteen and month >= thirty and month >= hour and month >= day and month >= week and month >= year then month else if year >= minute and year >= three and year >= five and year >= fifteen and year >= thirty and year >= hour and year >= day and year >= week and year >= month then year else Double.NaN; # BOTTOM plot bottom = if minute <= three and minute <= five and minute <= fifteen and minute <= thirty and minute <= hour and minute <= day and minute <= week and minute <= month and minute <= year then minute else if three <= minute and three <= five and three <= fifteen and three <= thirty and three <= hour and three <= day and three <= week and three <= month and three <= year then three else if five <= minute and five <= three and five <= fifteen and five <= thirty and five <= hour and five <= day and five <= week and five <= month and five <= year then five else if fifteen <= minute and fifteen <= three and fifteen <= five and fifteen <= thirty and fifteen <= hour and fifteen <= day and fifteen <= week and fifteen <= month and fifteen <= year then fifteen else if thirty <= minute and thirty <= three and thirty <= five and thirty <= fifteen and thirty <= hour and thirty <= day and thirty <= week and thirty <= month and thirty <= year then thirty else if hour <= minute and hour <= three and hour <= five and hour <= fifteen and hour <= thirty and hour <= day and hour <= week and hour <= month and hour <= year then hour else if day <= minute and day <= three and day <= five and day <= fifteen and day <= thirty and day <= hour and day <= week and day <= month and day <= year then day else if week <= minute and week <= three and week <= five and week <= fifteen and week <= thirty and week <= hour and week <= day and week <= month and week <= year then week else if month <= minute and month <= three and month <= five and month <= fifteen and month <= thirty and month <= hour and month <= day and month <= week and month <= year then month else if year <= minute and year <= three and year <= five and year <= fifteen and year <= thirty and year <= hour and year <= day and year <= week and year <= month then year else Double.NaN; top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); top.SetLineWeight(3); top.SetDefaultColor(Color.CYAN); top.SetHiding(!Show_lines); bottom.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); bottom.SetLineWeight(3); bottom.SetDefaultColor(Color.MAGENTA); bottom.SetHiding(!Show_lines); plot FTCUp = close crosses above top; FTCUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); FTCUp.SetDefaultColor(Color.gray); FTCUp.SetLineWeight(1); FTCUp.SetHiding(!Show_Arrows); plot FTCDN = close crosses below bottom; FTCDN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); FTCDN.SetDefaultColor(Color.gray); FTCDN.SetLineWeight(1); FTCDN.SetHiding(!Show_Arrows); addlabel(Show_Label, "CONTINUITY UP " + asdollars(top) + " DOWN " + asdollars(bottom) + " ", color.light_gray); addlabel(Show_Label, " USING: ", color.light_gray); addlabel(Show_Label and Use_Minute, "1min ", color.light_gray); addlabel(Show_Label and Use_Three, "3min ", color.light_gray); addlabel(Show_Label and Use_Five, "5min ", color.light_gray); addlabel(Show_Label and Use_Fifteen, "15min ", color.light_gray); addlabel(Show_Label and Use_Thirty, "30min ", color.light_gray); addlabel(Show_Label and Use_Sixty, "60min ", color.light_gray); addlabel(Show_Label and Use_Day, "Day ", color.light_gray); addlabel(Show_Label and Use_Week, "Week ", color.light_gray); addlabel(Show_Label and Use_Month, "Month ", color.light_gray); addlabel(Show_Label and Use_Year, "Year ", color.light_gray); # ----------------------------------- # BACKGROUND COLOR # ----------------------------------- DefineGlobalColor("UP”, CreateColor(000, 065, 000)); DefineGlobalColor("DOWN”, CreateColor(125, 000, 000)); assignBackgroundColor(if FTCUP then GlobalColor("UP") else if FTCDN then GlobalColor("DOWN") else color.black); input Use_Alerts = yes; Alert(Use_Alerts and FTCUP, "FTC Upside", Alert.BAR, Sound.Bell); Alert(Use_Alerts and FTCDN, "FTC Downside", Alert.BAR, Sound.Bell);
ACTIONABLE SIGNALS
THIS STUDY HAS BEEN INCORPORATED INTO THE STRAT REMIX STUDY AT THE TOP
This is the newest addition to my suite of products. Always double check the trade using basic PRICE ACTION and a thorough knowledge of The STRAT before you place a trade. As always, I encourage feedback especially if there are things you notice that could be improved or that are not working properly provided it is done in a respectful manner.
Be aware that often, signals are triggered and then price retraces back beyond the threshold of said signal. Those signals are no longer to be considered "IN FORCE." I have made every effort to have the label disappear when that happens. It is also possible for a signal to trigger, retrace, then trigger again (in fact, my experience has been that this is likely). In his videos, Rob encourages us to start with a small position, wait for the trigger, keep a high stop loss and if it triggers again with time frame continuity, get back in there. He sometimes refers to this as "doing battle." Trade management is beyond the scope of these particular studies, but if you have a signal in force on the larger time frame and full time frame continuity in your favor, you have every reason to want to add to your position, move your stop up, and exit when you see it reverse back on you in the higher time frame. Rob refers to this as "When we're right, we're REALLY right." My hope is that these actionable signal scripts together with my intended next project: scans, will be very helpful to you when used in conjunction with the whole of The Strat system (time frame continuity, broadening formations, etc) in building and adding to profitable positions. Happy trading!
Strat Reversals Remix and Actionable Signals Code
Code:#------------------------------------------------------------- # # S T R A T R E V E R S A L S # # A N D # # A C T I O N A B L E S I G N A L S # # R E M I X # # A study by Ramon DV. aka Pelonsax # # Version 1.0 8/01/20 # # Lost track of what version this is. 4-1-21 # Fixed Kickage issue, and measured move componenent # #------------------------------------------------------------- declare upper; #------------------------------------ # INPUTS #------------------------------------ input Show_Strat_Numbers = yes; input Show_Twos = yes; input Show_Legend = yes; input Alert_Actionable_Signals = yes; input Alert_Reversals = yes; input Paint_Candles = yes; #------------------------------------ # DEFINE SCENARIOS #------------------------------------ def H = high; def L = low; def C = close; def O = open; def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]); def outsidebar = H > H[1] and L < L[1]; def insidebarup = insidebar and O < C; def twoup = H > H[1] and L >= L[1]; def outsidebarup = outsidebar and O < C; def insidebardown = insidebar and O > C; def twodown = H <= H[1] and L < L[1]; def outsidebardown = outsidebar and O > C; #------------------------------------ # DEFINE REVERSALS (Basic four plus RevStrat) #------------------------------------ # Bullish def TwoOneTwoBull = twoup and insidebar[1] and twodown[2]; def TwoTwoBull = twoup and twodown[1]; def ThreeBull = outsidebarup and (twodown[1] or insidebar[1] or outsidebardown[1]); def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2]; def RevStratBull = (twoup and twodown[1] and insidebar[2]) or (outsidebarup and insidebar[1]); def BullRev = TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull or RevStratBull; # Bearish def TwoOneTwoBear = twodown and insidebar[1] and twoup[2]; def TwoTwoBear = twodown and twoup[1]; def ThreeBear = outsidebardown and (twoup[1] or insidebar[1] or outsidebarup[1]); def ThreeOneTwoBear = twodown and insidebar[1] and outsidebarup[2]; def RevStratBear = (twodown and twoup[1] and insidebar[2]) or (outsidebardown and insidebar[1]); def BearRev = TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear or RevStratBear; #------------------------------------ # STRAT NUMBERS #------------------------------------ plot barType = if Show_Strat_Numbers and insidebar then 1 else if Show_Strat_Numbers and outsidebar then 3 else if !insidebar and !outsidebar and Show_Twos then 2 else Double.NaN; barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); #------------------------------------ # CANDLE COLORS #------------------------------------ DefineGlobalColor("3U”, CreateColor(002, 092, 000)); DefineGlobalColor("2U”, CreateColor(002, 255, 000)); DefineGlobalColor("1U”, CreateColor(000, 255, 121)); DefineGlobalColor("3D”, CreateColor(138, 000, 020)); DefineGlobalColor("2D”, CreateColor(255, 000, 030)); DefineGlobalColor("1D”, CreateColor(255, 166, 161)); AssignPriceColor(if Paint_Candles and BullRev then Color.CYAN else if Paint_Candles and BearRev then Color.MAGENTA else if Paint_Candles and !BullRev and !BearRev and twoup then GlobalColor("2U”) else if Paint_Candles and !BullRev and !BearRev and twodown then GlobalColor("2D”) else if Paint_Candles and !BullRev and !BearRev and outsidebarup then GlobalColor("3U”) else if Paint_Candles and !BullRev and !BearRev and insidebarup then GlobalColor("1U”) else if Paint_Candles and !BullRev and !BearRev and outsidebardown then GlobalColor("3D”) else if Paint_Candles and !BullRev and !BearRev and insidebardown then GlobalColor("1D”) else if Paint_Candles and !BullRev and !BearRev and !insidebarup and !insidebardown and insidebar then Color.WHITE else if Paint_Candles and !BullRev and !BearRev and !outsidebardown and !outsidebarup and outsidebar then Color.WHITE else Color.CURRENT); #------------------------------------ # COLOR LEGEND #------------------------------------ # Red Green AddLabel(if Show_Legend then yes else no, "Color Coding: ", Color.LIGHT_GRAY); AddLabel(if Show_Legend then yes else no, “Two Up”, GlobalColor("2U”)); AddLabel(if Show_Legend then yes else no, “Inside Bar Up”, GlobalColor("1U”)); AddLabel(if Show_Legend then yes else no, “Outside Bar Up”, GlobalColor("3U”)); AddLabel(if Show_Legend then yes else no, “Two Down”, GlobalColor("2D”)); AddLabel(if Show_Legend then yes else no, “Inside Bar down”, GlobalColor("1D”)); AddLabel(if Show_Legend then yes else no, “Outside Bar Down”, GlobalColor("3D”)); AddLabel(if Show_Legend then yes else no, “Reversal Up”, Color.CYAN); AddLabel(if Show_Legend then yes else no, “Reversal Down”, Color.MAGENTA); # HAMMER input Hammer_length = 30; input Hammer_trendSetup = 3; input Hammer_bodyFactor = 0.3; input Hammer_shadowFactor = 2.0; Assert(Hammer_bodyFactor >= 0, "'body factor' must not be negative: " + Hammer_bodyFactor); Assert(Hammer_shadowFactor >= 0, "'shadow factor' must not be negative: " + Hammer_shadowFactor); def Hammer_BodyHeight = BodyHeight(); def Hammer_AverageBodyHeight = Average(Hammer_BodyHeight, Hammer_length); def Hammer_ErrMargin = 0.25 * Hammer_AverageBodyHeight; def Hammer_IsShort = Hammer_BodyHeight <= Hammer_bodyFactor * Hammer_AverageBodyHeight; def Hammer = IsDescending(C, Hammer_trendSetup)[1] and Hammer_IsShort and H - Max(O, C) <= Hammer_ErrMargin and Min(O, C) - L > Hammer_shadowFactor * Hammer_BodyHeight; # SHOOTER input Star_length = 30; input Star_trendSetup = 3; input Star_bodyFactor = 0.3; input Star_shadowFactor = 2.0; Assert(Star_bodyFactor >= 0, "'body factor' must not be negative: " + Star_bodyFactor); Assert(Star_shadowFactor >= 0, "'shadow factor' must not be negative: " + Star_shadowFactor); def Star_BodyHeight = BodyHeight(); def Star_AverageBodyHeight = Average(Star_BodyHeight, Star_length); def Star_ErrMargin = 0.25 * Star_AverageBodyHeight; def Star_IsShort = Star_BodyHeight <= Star_bodyFactor * Star_AverageBodyHeight; def ShootingStar = IsAscending(C, Star_trendSetup)[1] and Star_IsShort and Min(O, C) - L <= Star_ErrMargin and H - Max(O, C) > Star_shadowFactor * Star_BodyHeight; # ------------------------- # ACTIONABLE SIGNALS # ------------------------- def InsideUp = insidebar[1] and C crosses above H[1] and C > H[1]; def InsideDown = insidebar[1] and C crosses below L[1] and C < L[1]; def KickingBull = O >= H[1] and C > O and C[1] < O[1]; def KickingBear = O <= L[1] and C < O and C[1] > O[1]; def HammerRev = Hammer[1] and C crosses above H[1] and C > H[1]; def ShooterRev = ShootingStar[1] and C crosses below L[1] and C < L[1]; def MomoStar = IsDescending(C, Star_trendSetup)[2] and Star_IsShort[1] and Min(O[1], C[1]) - L[1] <= Star_ErrMargin and H[1] - Max(O[1], C[1]) > Star_shadowFactor * Star_BodyHeight and C crosses below L[1] and C < L[1]; def MomoHammer = IsAscending(C, Hammer_trendSetup)[2] and Hammer_IsShort[1] and H[1] - Max(O[1], C[1]) <= Hammer_ErrMargin and Min(O[1], C[1]) - L[1] > Hammer_shadowFactor * Hammer_BodyHeight and C crosses above H[1] and C > H[1]; input RangeAVG = AverageType.SIMPLE; input RangeLength = 13; input MeasuredMove_Sensitivity = 50; def MMS = MeasuredMove_Sensitivity / 100; def ATR = MovingAverage(RangeAVG, TrueRange(H, C, L), RangeLength); def topH = (ATR[1] / 2) + L[1]; def Now = L >= topH; def MeasuredUp = (TrueRange(H[2], C[2], L[2]) > (MMS * ATR)) and topH and Now and insidebar[1] and C crosses above H[1]; def MeasuredDown = (TrueRange(H[2], C[2], L[2]) > (MMS * ATR)) and topH and Now and insidebar[1] and C crosses below L[1]; def ActionableUp = InsideUp or KickingBull or RevStratBull or HammerRev or MomoHammer or MeasuredUp; def ActionableDown = InsideDown or KickingBear or RevStratBear or ShooterRev or MomoStar or MeasuredDown; # ------------------------- # SIGNAL ALERTS # ------------------------- AddLabel(ActionableUp or ActionableDown, ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), if ActionableUp then Color.CYAN else if ActionableDown then Color.MAGENTA else Color.BLACK); Alert(Alert_Actionable_Signals and (ActionableUp or Actionabledown), ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), Alert.BAR, Sound.ring); Alert(Alert_Reversals and BullRev, ("Bull Reversal: " + if TwoOneTwoBull then "2D-1-2U" else if TwoTwoBull then "2D-2U" else if ThreeBull then "3U" else if ThreeOneTwoBull then "3-1-2U" else if RevStratBull then "Rev Strat Up" else ""), Alert.BAR, Sound.Bell); Alert(Alert_Reversals and BearRev, ("Bear Reversal: " + if TwoOneTwoBear then "2U-1-2D" else if TwoTwoBear then "2U-2D" else if ThreeBear then "3D" else if ThreeOneTwoBear then "3-1-2D" else if RevStratBear then "Rev Strat Down" else ""), Alert.BAR, Sound.Bell);
BROADENING FORMATIONS (1ST DRAFT)
This study will only find 1-3 combos and extend diagonal lines outward. I wasn't going to release it yet because I'm waiting to really make it work with multi bar pivots, but someone asked for exactly this in the comments and since this one is ready now, here you go. Keep in mind that this is not exactly the same as a broadening formation as Rob describes it. (It is and it isn't. This is only one example of a broadening formation). It could come in handy if you want to run it on a higher time frame like the daily or weekly and then draw over the lines so that it shows up on the lower time frames. I have to credit Halcyon Guy (Don L.) who wrote the backbone and has given me permission to publish. I moded his version of a similar study that looks for wedges. This is basically the 2 bar inverse of his study.
3_1_Broadening_Formation
https://tos.mx/U6xvWgx
Code:## ---------------------------------------- # BROADENING FORMATION # A STRAT STUDY BY PELONSAX AKA RAMON DV # # ADAPTED FROM # quadinsidebar_01 # 2020-06-27 # halcyonguy # ---------------------------------------- input extend_lines = 100; def na = double.nan; def hi = high; def lo = low; def bn = barnumber(); # ----- 2 bar outside pattern --------------------------------- def insidebar0 = hi < hi[-1] and lo > lo[-1]; def insidebar = insidebar0 or insidebar0[1]; def next = insidebar0[-1]; def pattern = fold i = 0 to extend_lines with p do if i > bn then p + 0 else p + GetValue(insidebar,i); def extend = if (!next and pattern > 0) then 1 else 0; def en_slopelines = extend; # =================================================================== def bargaps = 1; def slopehi2 = (hi[-bargaps] - hi[0])/bargaps; def slopelo2 = (lo[-bargaps] - lo[0])/bargaps; def slopehi = if insidebar0 then slopehi2 else if en_slopelines then slopehi[1] else na; def slopelo = if insidebar0 then slopelo2 else if en_slopelines then slopelo[1] else na; def bar0number = if insidebar0 then barnumber() else if en_slopelines then bar0number[1] else na; def bar0high = if insidebar0 then hi else if en_slopelines then bar0high[1] else na; def bar0low = if insidebar0 then lo else if en_slopelines then bar0low[1] else na; plot diaghi = if en_slopelines then ( bar0high + (slopehi * (barnumber() - bar0number))) else na; diaghi.AssignValueColor(Color.dark_Green); diaghi.SetStyle(Curve.MEDIUM_DASH); plot diaglo = if en_slopelines then ( bar0low + (slopelo * (barnumber() - bar0number))) else na; diaglo.AssignValueColor(Color.dark_green); diaglo.SetStyle(Curve.MEDIUM_DASH); # # ------------------------------------------------------------------ #
!!ACTIONABLE SIGNAL SCANS!!
Rather than go into another lengthy description, I just decided to make a video and post the links.
1 Bar Rev Strat Daily
https://tos.mx/sml8vKo
2 Bar Rev Strat Daily
https://tos.mx/fUIotqN
Hammer Rev
https://tos.mx/A2w2Jkt
Inside Break Bull
https://tos.mx/JKIrGGZ
Kicking Bull
https://tos.mx/JLI4AXC
Link to James Fox’s STRAT Scan video:
UPDATE: 03/23/21 Tried to re-upload complete overlay charts with a new link because I noticed that they were set to use log scale. I noticed it messes with my drawings so I turn it off on all my charts. I think it's the best setting. Ill try to give y'all fresh links later (probably just a problem with TOS right now), but for now, to change it manually, it looks like this:
UPDATE: 04/01/21 Updated Kicker Actionable signal to include opposite continuity for kick age and fixed bug with measured move. Streamlined thread removing studies that are now obsolete.
UPDATE: 02/28/21 Added TFC study to Pre-Loaded Color Overlay Charts. This is because the Complete TFC study at the top changes the color of the background which defeats the purpose of the color overlay chart on a white background. This is simply a condensed, simplified version of the TFC study. It will only work if the intraday chart is set to 1 minute and the full chart is set to 1 hour.
UPDATE: 02/28/21 Added additional new version of color script. Re-worked the colors to let each TF stand out.
UPDATE: 02/26/21 Added new color version of the overlay study. There are three separate versions, each a different shade.
UPDATE: 01/02/21 Corrected bug in watchlist columns. Then you very much for catching that @fishstick1229 !!!!!!
UPDATE: 10/19/20 Placed link for the two main studies at the top. Added set up tutorial video for two main (most recent studies). Removed older studies (Basic Four). Added Hammers_and_Shooters study. Added Actionable Signal Scans and video
UPDATE: 10/15/20 Made Background Color script all inclusive and MTF capable. Added specific type of actionable signal onto the alerts written into the Remix version
UPDATE: 10/14/20 Per request, added alerts for reversals to the Reversal Remix and Actionable Signal study. Added alert to Background Color FTC Study. Added 1st draft Broadening Formation study.
That's because a 2-2 reversal is not an actionable signal.I have noticed that 2-2 reversals dont seem to show up on the actionable signals?
all the others ones do but seems that any 2-2 reversal isnt alerting or showing up...i looked at the code and it doesnt seem to be in there either?
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.