blackFLAG FTS - SwingArm Trend Indicator using ATRTrailing Stop and Fibonacci Retracements

Status
Not open for further replies.
I was able to do the 1min,5min,15min,30min,1hr,4hr,and daily. Would it be a good idea to put in the weekly and monthly? I just copy and paste the same on while changing the options to 1min,5min ext...

Thanks
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

The alerts will not open in thinkorswim and display an error stating to contact tech support.

Sagar and I are having the same issues.

I3zMU5L.png


https://tos.mx/U57qwzJ
cause the link is broken imo
 
Ok so at this Moment SPY 🕵️‍♂️ is on the daily support, and right on the weekly support as well. I have the two of them charted out. I'm being patient and waiting for it to break above the w of them. But in all zones it just has green. Which makes me want to buy but I'm thinking it reverses here. Any thoughts....
 
@luiscervantes30 In your watchlist column, make sure you either enable or disable extended hours option, whichever option you're using on your chart.
 
@BenTen It's generic error when you try to import the below TOS shared links.. "An error occurred while importing shared item. Please consult with tech support"

Only below links not all...
Can ypu import it without any issue then not sure i see few people complaining about this.. something is missing.
 
@greygoose Can you please Publish the raw scan code for the bullish and bearish BlackFLAG scanners? The one listed here erupts an error when you preview and try to load it.
 
@greygoose Can you please Publish the raw scan code for the bullish and bearish BlackFLAG scanners? The one listed here erupts an error when you preview and try to load it.

Here is a Link for SwingArm Bullish 1 Minute. Instead of pasting the code, just use the link and it throws it onto thinkorswim for you. just rename it when you save it:
https://tos.mx/wBQ1VmE
You could then change the time period (you don't have to copy/paste the code) and then rename it and save it for, say 5 minutes. Then 10 Minutes or whatever time period you wish and as many time periods as you desire.

If you want the just the code, I am pasting it below.

I hope this is what you're looking for

Code:
# blackFLAG Futures Trading SwingArm Scan Code

# BULLISH CODE
# Source: TD Ameritrade IP Company, Inc. (c) 2009-2016
#
input trailType = {default modified, unmodified};
input ATRPeriod = 28;
input ATRFactor = 5;
input firstTrade = {default long, short};
input averageType = AverageType.WILDERS;
Assert(ATRFactor > 0, "'atr factor' must be positive: " + ATRFactor);
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1] then high - close[1] else (high - close[1]) - 0.5 * (low - high[1]); def LRef = if high >= low[1]
then close[1] - low
else (close[1] - low) - 0.5 * (low[1] - high);
def trueRange;
switch (trailType) {
case modified:
trueRange = Max(HiLo, Max(HRef, LRef));
case unmodified:
trueRange = TrueRange(high, close, low);
}
def loss = ATRFactor * MovingAverage(averageType, trueRange, ATRPeriod);
def state = {default init, long, short};
def trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
} else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
} else {
state = state.long;
trail = close - loss;
}
}
def BuySignal = Crosses(state == state.long, 0, CrossingDirection.ABOVE);
def SellSignal = Crosses(state == state.short, 0, CrossingDirection.ABOVE);
# move comment markers dependin on which of these two you want to run
plot scan = BuySignal;
#plot scan = SellSignal;

link for BEARISH swingarm 10 minute (but you can change the time period to something else, then add more time periods as you wish, whatever you want to do):
https://tos.mx/fJKB38y
the raw code

Code:
# blackFLAG Futures Trading SwingArm Scan Code
# BEARISH CODE
#
# TD Ameritrade IP Company, Inc. (c) 2009-2016
#
input trailType = {default modified, unmodified};
input ATRPeriod = 28;
input ATRFactor = 5;
input firstTrade = {default long, short};
input averageType = AverageType.WILDERS;
Assert(ATRFactor > 0, "'atr factor' must be positive: " + ATRFactor);
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1] then high - close[1] else (high - close[1]) - 0.5 * (low - high[1]); def LRef = if high >= low[1]
then close[1] - low
else (close[1] - low) - 0.5 * (low[1] - high);
def trueRange;
switch (trailType) {
case modified:
trueRange = Max(HiLo, Max(HRef, LRef));
case unmodified:
trueRange = TrueRange(high, close, low);
}
def loss = ATRFactor * MovingAverage(averageType, trueRange, ATRPeriod);
def state = {default init, long, short};
def trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
} else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
} else {
state = state.long;
trail = close - loss;
}
}
def BuySignal = Crosses(state == state.long, 0, CrossingDirection.ABOVE);
def SellSignal = Crosses(state == state.short, 0, CrossingDirection.ABOVE);
# move comment markers dependin on which of these two you want to run
#plot scan = BuySignal;
plot scan = SellSignal;
 
Last edited by a moderator:
@luiscervantes30 In your watchlist column, make sure you either enable or disable extended hours option, whichever option you're using on your chart.
Oh totally forgot about doing that. Can you give a quick rundown on how it's supposed to be used. Sorry I bug 🐛 so much. For instance today I did a Tesla put exp this Friday. In the 15 min zone it said sell zone. Thanks again.
 
Odd request i tend to have issues in tos even through the fixes mentioned by others and am requesting if it were possible to translate the thinkscript code of jose's swing arms into pinescript?
 
Status
Not open for further replies.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
354 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top