Average Price Movements Indicator for ThinkorSwim

fjr1300

fjr1300

Active member
VIP
@Playstation I just found this:

Code:
input length = 14;
input averageType = AverageType.WILDERS;
plot ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
AddLabel(yes, ATR, if ATR < 0.25 then Color.GREEN else if ATR > 0.15 then Color.YELLOW else Color.WHITE);

Source: [URL]https://www.hahn-tech.com/ans/add-chart-label-for-average-true-range-atr/[/URL]

It must have the ability to consider: 
input ATRPeriod
input ATRFactor
input averageType = averageType.WILDERS
I believe...
 
Last edited:
P

Playstation

Active member
VIP
@fjr1300

Dont have to be so complicated cause your values are already defined inside the script. I believe the below is what you want?
You can change the price to other variables such as open or close etc.

AddLabel(yes, if ohlc4 > TrailingStop then "BULLISH SWINGARM" else "BEARISH SWINGARM", if ohlc4 > TrailingStop then Color.GREEN else Color.Red);
 
M

mansor

Member
@Playstation @fjr1300 thanks for sharing this avg price mov script.

So, I have downloaded and applied post #15 by playstation on 10D 1h chart on my flex grid. It gives red and green resistance and support levels for each day. Cool. Second, it gives red & green bubbles, red for resistance with a price and green for support with price. Great!

Now, jumping to @fjr1300 post #23 - What needs to be added in the script to get:
A. Labels: green/red/yellow
AND
B. Bubbles sell confirmed, buy confirmed that's shown in the picture of #23.

I added @Playstation post #22
"AddLabel(yes, if ohlc4 > TrailingStop then "BULLISH SWINGARM" else "BEARISH SWINGARM", if ohlc4 > TrailingStop then Color.GREEN else Color.Red);"

However, after adding to script post #15, it gave red background over "trailingstop"

I am not a coder, any help would be beneficial. Thanks again

Edit ----

After reading blagflag thread, I realized that addLabel that @Playstation had posted was for swingarm script & not for avg pr mov. I have added the above label and I am getting label bullish swingarm. Next Q is @fjr1300 can you please advise what script needs to be modified to have sell/buy confirmed bubbles as well.

I am using @Playstation post 15 script along with blackflag script post 1 in your thread - and - hull ma con turning pts. Any help would be great. Using this on 1d 10m chart.
 
Last edited:
fjr1300

fjr1300

Active member
VIP
@mansor Hi. This is how I use it for day trading:

This is one way to use the SwingArms for Day Trading:
MONITOR #1 1 Minute Grid https://tos.mx/lM0nCpx MONITOR #2 5 Minute Grid 2 Charts basic view and Trend Momentum View https://tos.mx/J6DFRbk

blackFLAG FTS SwingArm 1 Minute Grid

blackFLAG SwingArm - 5 Minute Grid

Trade in the direction of the 5 Minute when the One Minute setups and agrees to move in the same direction. High probability, low risk, high reward.

Recognizing that the 1 min may cycle as the trade develops. Option one, close trade as the 1 min breaks down or ride it and keep stop below the 5 min. swingarm.

Stay in the trade as long as the 5 min is bullish.

or vice versa with an awareness of higher timeframe swingarm locations to know if you are getting too close to support or resistance zones
 
M

mansor

Member
@fjr1300 Thank you for taking time to explain me. I have a 1 small question.

In your post #23, you have a picture. The picture is depicting 1 (sell resistance), 2(sell confirmation), 3, 4(buy confirmation), 5(buy support). Each corresponding to a bubble. These bubbles are from hull moving averages con turning points. I did download the script from Post #271, link below

https://usethinkscript.com/threads/...avity-2nd-derivatives.1803/page-14#post-23080
I am getting buy support & sell resistance bubbles, BUT NOT sell/buy confirmation bubbles.

Second point, I used hull ma con turning point script from the above post (your post) and applied it, now I am only getting yellow buy and sell confirmation bubbles and NOT green(buy support) & red(sell resistance) bubbles

It's a bit confusing now, I just need to figure out how to get yellow bubbles along with red & green bubbles instead of running both scripts as they overlap.

Thank you again
 
fjr1300

fjr1300

Active member
VIP
You are correct. This is work in process. So, tomorrow we will have a zoom meeting to update all members as to the latest and work that is still being organized prior to sharing it. Thank you for your patience. But count on me and the group leadership in guiding us all in the right direction.
 
P

Playstation

Active member
VIP
As per @fjr1300 request from:

https://usethinkscript.com/threads/...fibonacci-retracements.2486/page-5#post-24703
I've included a condition where if price breaks above resistance or below support, a label will indicate prior resistance or support.

Code:
#Edited By Playstation 23.05.2020
#You can set whether to show the bubbles. Change or add the h1,h2,l1,l2 values to your preference.

input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

#This will show the price at the support and resistance levels.
AddChartBubble(SR,h2,Concat("R: ",Round(h2)),Color.RED);
AddChartBubble(SR,l2,Concat("S: ",Round(l2)),Color.GREEN);

#Swap hashtags if you want just the Resistance/Support words.
#AddChartBubble(SR, h2, "DAILY RESISTANCE", Color.RED);
#AddChartBubble(SR, l2, "DAILY SUPPORT", Color.GREEN);

#Edited By Playstation 26.05.2020
#Added Labels to indicate request of adding labels to show price when breakabove resistance or below support.
AddLabel(yes, if close > h1 == yes then "Prior Resistance May Become Support" else "", color.BLUE);
AddLabel(yes, if close < l1 == yes then "Prior Support May Become Resistance" else "", color.BLUE);
 
M

mini

Member
Thank you for sharing this great indicator! Is it possible to make a scan version for the support and resistance?
 
BenTen

BenTen

Administrative
Staff
VIP
@mini What are you trying to scan for? You can do that via the Scan tab.
 
M

mini

Member
@mini What are you trying to scan for? You can do that via the Scan tab.
I want to scan stocks which reach the support zone and resistance zone? Is that possible to create a script for it?
 
S

saham

New member
@mansor Hi. This is how I use it for day trading:

This is one way to use the SwingArms for Day Trading:
MONITOR #1 1 Minute Grid https://tos.mx/lM0nCpx MONITOR #2 5 Minute Grid 2 Charts basic view and Trend Momentum View https://tos.mx/J6DFRbk

blackFLAG FTS SwingArm 1 Minute Grid

blackFLAG SwingArm - 5 Minute Grid

Trade in the direction of the 5 Minute when the One Minute setups and agrees to move in the same direction. High probability, low risk, high reward.

Recognizing that the 1 min may cycle as the trade develops. Option one, close trade as the 1 min breaks down or ride it and keep stop below the 5 min. swingarm.

Stay in the trade as long as the 5 min is bullish.

or vice versa with an awareness of higher timeframe swingarm locations to know if you are getting too close to support or resistance zones
hi
can you fix this one
blackFLAG FTS SwingArm 1 Minute Grid
thank you
 
H

Hguru

Member
@fjr1300 does your swingarm system work using tick charts, I trade CL using a 1600 tick mostly and watch the 750 tick as well along with the 5 min and 15 min and 1 hour for getting a sense of the longer trend. thx
 
BenTen

BenTen

Administrative
Staff
VIP
@Hguru Just add the swingarm indicator to your tick chart and you will see. It's important to note that Jose only trade futures and he's using time chart.
 
H

Hguru

Member
@Hguru Just add the swingarm indicator to your tick chart and you will see. It's important to note that Jose only trade futures and he's using time chart.
Ben, i have not downloaded it yet because there is so much to that study that if it does not work for tick charts no point in adding it for me. plus not exactly sure which is the most current or the one i should download it is a little confusing after reading all about it, thanks for your help
 
Y

yman

New member
I want to backtest the Average Price Movement indicator need help dont know how to write command for exiting trade and stop loss.
 
BenTen

BenTen

Administrative
Staff
VIP
@yman List out the conditions for your backtesting strategy.
 
BenTen

BenTen

Administrative
Staff
VIP
Quick modification to the indicator requested by @dvorakm with the ability to show only current day's zones.

Code:
# Average Price Movements
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eHhGyI6R-CD-Average-Daily-Range-Zones-highs-and-lows-of-the-day/

input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;

input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def dayrange = (high - low);

def r1 = dayrange[1];
def r2 = dayrange[2];
def r3 = dayrange[3];
def r4 = dayrange[4];
def r5 = dayrange[5];
def r6 = dayrange[6];
def r7 = dayrange[7];
def r8 = dayrange[8];
def r9 = dayrange[9];
def r10 = dayrange[10];

def adr_10 = (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10;
def adr_5 = (r1 + r2 + r3 + r4 + r5) / 5;

def hl1 = (OPEN + (adr_10 / 2));
def ll1 = (OPEN - (adr_10 / 2));
def hl2 = (OPEN + (adr_5 / 2));
def ll2 = (OPEN - (adr_5 / 2));

plot upper2 = if ShowTodayOnly and !Today then Double.NaN else hl1;
plot lower1 = if ShowTodayOnly and !Today then Double.NaN else ll2;
plot upper1 = if ShowTodayOnly and !Today then Double.NaN else hl2;
plot lower2 = if ShowTodayOnly and !Today then Double.NaN else ll1;

addCloud(if ShowTodayOnly == yes then upper2 else double.nan, upper1,color.red, color.red);
addCloud(if ShowTodayOnly == yes then lower1 else double.nan, lower2,color.green, color.green);

upper1.SetDefaultColor(Color.dark_red);
upper2.SetDefaultColor(Color.dark_red);
lower1.SetDefaultColor(Color.dark_green);
lower2.SetDefaultColor(Color.dark_green);
 
Top