Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.
Hi Slippage, which is the scan i can use for price above sma50s and moxie above zero on the daily?
u r a gem! thank u once again! eternally grateful.You can find the pieces you need for that in this post. You want #2 and #3. You can also use those for any other timeframes you want just by adjusting the timeframe of the scan.
MUCHO THANKS, I'M USING THE MOXIE CHANNEL ALONG WITH THE MOXIE LOWER.@tradegeek IMO, I would just move on. Never buy an indicator. Find a system that works for you and keep working it. There are many hundred of them on this website to research. Start in the Tutorials as well as Look at the built in Strategies.
Code:# Moxie_PriceChannel_Adjustable # Built on 5/11/20 # For use on a All Time Frames input channelLength = 34; input averageType = AverageType.EXPONENTIAL; input PriceChannel_Aggregation = AggregationPeriod.FIFTEEN_MIN; input Moxie_highestAggregation = AggregationPeriod.TEN_MIN; input Moxie_lowestAggregation = AggregationPeriod.FIVE_MIN; def MovAvg_H = MovingAverage(averageType, high, channelLength); def MovAvg_C = MovingAverage(averageType, close, channelLength); def MovAvg_L = MovingAverage(averageType, low, channelLength); def MovAvg_H1x = (MovAvg_H - MovAvg_L) + MovAvg_H; def MovAvg_L1x = MovAvg_L - (MovAvg_H - MovAvg_L); # HTF_Ergodic Momentum ---------------------------------------------- def diff = close(period=PriceChannel_Aggregation) - close(period=PriceChannel_Aggregation)[1]; def TSI = (ExpAverage(ExpAverage(diff, 32), 5)) / (ExpAverage(ExpAverage(AbsValue(diff), 32), 5)) * 100; def Signal = ExpAverage(TSI, 5); def Momentum = TSI - Signal; def LHMult = If (.01 <> 0, (1 / 0.01), 0); def TSVBlues = If (Momentum >= 0, Momentum, 0); def TSVMomentum_Pos = TSVBlues * LHMult; def TSVReds = If (Momentum < 0, Momentum, 0); def TSVMomentum_Neg = TSVReds * LHMult; # HTF ERGODIC Price Channel Momentum Indicator ---------------------------------------- plot PC_H = MovAvg_H; plot PC_L = MovAvg_L; PC_H.DefineColor("SlopeUp", CreateColor(0, 153, 0)); #createColor(0,153,0)); GREEN PC_H.DefineColor("NoSlope", Color.GRAY); PC_H.DefineColor("SlopeDown", Color.RED); PC_H.AssignValueColor(if TSVmomentum_Pos then PC_H.Color("SlopeUp") else if TSVmomentum_Neg then PC_L.Color("SlopeDown") else PC_H.Color("NoSlope")); PC_H.SetLineWeight(2); PC_H.HideBubble(); PC_L.DefineColor("SlopeUp", CreateColor(0, 153, 0));#createColor(0,153,0)); GREEN PC_L.DefineColor("NoSlope", Color.GRAY); PC_L.DefineColor("SlopeDown", Color.RED); PC_L.AssignValueColor(if TSVmomentum_Pos then PC_L.Color("SlopeUp") else if TSVmomentum_Neg then PC_L.Color("SlopeDown") else PC_L.Color("NoSlope")); PC_L.SetLineWeight(2); PC_L.HideBubble(); # MOXIE - This section is for the medium term MACD --------------------------------------------- def midTermFastAvg = ExpAverage(close(period = Moxie_lowestAggregation), 12); def midTermSlowAvg = ExpAverage(close(period = Moxie_lowestAggregation), 26); def midTermValue = midTermFastAvg - midTermSlowAvg; def midTermAvg = ExpAverage(midTermValue, 9); def midTermDiff = (midTermValue - midTermAvg)*3; # MOXIE - This section is for the long term MACD ----------------------------------------------- def longTermFastAvg = ExpAverage(close(period = Moxie_highestAggregation), 12); def longTermSlowAvg = ExpAverage(close(period = Moxie_highestAggregation) , 26); def longTermValue = longTermFastAvg - longTermSlowAvg; def longTermAvg = ExpAverage(longTermValue, 9); def longTermDiff = (longTermValue - longTermAvg)*3; # Signal Criteria ----------------------------------------------------------------------- def midTermLower = midTermDiff < 0 and midTermDiff < midTermDiff[1]; def midTermHigher = midTermDiff > 0 and midTermDiff > midTermDiff[1]; def longTermLower = longTermDiff < 0 and longTermDiff < longTermDiff[1]; def longTermHigher = longTermDiff > 0 and longTermDiff > longTermDiff[1]; ######################################################################### plot BuySignal = if midTermHigher and LongTermHigher then MovAvg_L1x else Double.NaN; BuySignal.SetDefaultColor (Color.White); #(CreateColor(0, 153, 0)); BuySignal.SetPaintingStrategy(PaintingStrategy.POINTS); BuySignal.SetLineWeight(2); BuySignal.HideBubble(); BuySignal.HideTitle(); plot SellSignal = if midTermLower and LongTermLower then MovAvg_H1x else Double.NaN; SellSignal.SetDefaultColor(Color.White); SellSignal.SetPaintingStrategy(PaintingStrategy.POINTS); SellSignal.SetLineWeight(2); SellSignal.HideBubble(); SellSignal.HideTitle(); # Cloud Fill ----------------------------- AddCloud(MovAvg_H, MovAvg_L, Color.LIGHT_GRAY); alert (close>BuySignal,"ChannelDotup", alert.bar,Sound.ding); alert (close<SellSignal,"ChannelDotdown", alert.bar,Sound.ding); #alert (close>BuySignal,"ChannelDotup", alert.once,Sound.ding); #alert (close<SellSignal,"ChannelDotdown", alert.once,Sound.ding);
@Slippage in regards to post #209, did you say you were going to write or update the code for that post? I love the smooth Moxie line, much easier on the eyes. Thank you very much.
This is the moxie lwr I am currently running.Squeeze is in both versions now, as of whatever time I posted that reply.
Be careful with the smooth version. Most of the time it looks like it reasonably matches the stair-steps but once in a while the two indicators cross zero a little apart from each other and I noticed today during market hours that sometimes they look like they're doing completely different things on the newest candle. I'll be running both for quite a while I think, until I get a feel for which I trust more.
can you email that?
@Slippage Thank you for the quick response and your interesting observations of the differences. I will stick with the stairsteps until hearing from you further.
declare lower;
input showVerticalLines = yes;
input showTrampolines = yes;
input showSqueezeDots = no;
input showLabel = yes;
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetLineWeight(2);
ZeroLine.HideBubble();
ZeroLine.HideTitle();
def currentAggPeriod = GetAggregationPeriod();
def multiplier =
if currentAggPeriod <= AggregationPeriod.TWO_MIN then AggregationPeriod.FIVE_MIN / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.THREE_MIN then AggregationPeriod.TEN_MIN / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.FIVE_MIN then AggregationPeriod.FIFTEEN_MIN / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.TEN_MIN then AggregationPeriod.THIRTY_MIN / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.FIFTEEN_MIN then AggregationPeriod.HOUR / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.THIRTY_MIN then AggregationPeriod.TWO_HOURS / currentAggPeriod
else if currentAggPeriod <= AggregationPeriod.HOUR then 7
else if currentAggPeriod <= AggregationPeriod.TWO_HOURS then 3
else if currentAggPeriod <= AggregationPeriod.FOUR_HOURS then 3 # yes, weird, but this matches better
else if currentAggPeriod <= AggregationPeriod.DAY then 5
else if currentAggPeriod <= AggregationPeriod.WEEK then AggregationPeriod.MONTH / currentAggPeriod
else AggregationPeriod.QUARTER / currentAggPeriod
;
script MoxieFunc {
input factor = 1;
def v = ExpAverage(close, 12*factor) - ExpAverage(close, 26*factor);
def a = ExpAverage(v, 9*factor);
plot m = (v - a) * 3;
}
plot Moxie = MoxieFunc(multiplier)[34];
plot Moxie2 = MoxieFunc(multiplier)[-34];
Moxie.SetLineWeight(2);
Moxie.DefineColor("Up", Color.UPTICK);
Moxie.DefineColor("Down", Color.RED);
Moxie.AssignValueColor(
if Moxie < Moxie[1] then Moxie.Color("Down")
else Moxie.Color("Up")
);
Moxie.HideBubble();
Moxie.HideTitle();
# Watkins uses a different setup for Moxie on his 15 minute charts.
# He uses two lines derived from two higher timeframes.
def secondMultiplier =
if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then 7
else currentAggPeriod
;
plot MoxieSecondLine =
if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN
then MoxieFunc(secondMultiplier)
else Double.NaN
;
MoxieSecondLine.SetLineWeight(2);
MoxieSecondLine.DefineColor("Up", Color.UPTICK);
MoxieSecondLine.DefineColor("Down", Color.RED);
MoxieSecondLine.AssignValueColor(
if MoxieSecondLine < MoxieSecondLine[1] then MoxieSecondLine.Color("Down")
else MoxieSecondLine.Color("Up")
);
MoxieSecondLine.HideBubble();
MoxieSecondLine.HideTitle();
MoxieSecondLine.SetHiding(currentAggPeriod != AggregationPeriod.FIFTEEN_MIN);
# Show vertical lines at crossovers
AddVerticalLine(showVerticalLines and Moxie[1] crosses above 0, "", CreateColor(0,150,0), Curve.SHORT_DASH);
AddVerticalLine(showVerticalLines and Moxie[1] crosses below 0, "", CreateColor(200,0,0), Curve.SHORT_DASH);
# Indicate the Trampoline setup
def sma50 = Average(close, 50);
plot Trampoline =
if showTrampolines and ((Moxie < -.01 and close > sma50) or (Moxie > .01 and close < sma50))
then 0
else Double.NaN
;
Trampoline.SetPaintingStrategy(PaintingStrategy.SQUARES);
Trampoline.DefineColor("Bullish", Color.LIGHT_GREEN);
Trampoline.DefineColor("Bearish", Color.PINK);
Trampoline.AssignValueColor(if close > sma50 then Trampoline.Color("Bearish") else Trampoline.Color("Bullish"));
Trampoline.HideBubble();
Trampoline.HideTitle();
# show squeeze dots on zero line
def squeezeLevel =
if TTM_Squeeze(nK=1.0).SqueezeAlert == 0 then 3
else if TTM_Squeeze(nK=1.5).SqueezeAlert == 0 then 2
else if TTM_Squeeze(nK=2.0).SqueezeAlert == 0 then 1
else 0
;
plot Squeeze = if !showSqueezeDots then Double.NaN else 0;
Squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);
Squeeze.SetDefaultColor(Color.GRAY);
Squeeze.DefineColor("Loose Squeeze", Color.UPTICK);
Squeeze.DefineColor("Squeeze", Color.RED);
Squeeze.DefineColor("Tight Squeeze", Color.YELLOW);
Squeeze.DefineColor("No Squeeze", Color.GRAY);
Squeeze.AssignValueColor(
if squeezeLevel == 3 then Squeeze.Color("Tight Squeeze")
else if squeezeLevel == 2 then Squeeze.Color("Squeeze")
else if squeezeLevel == 1 then Squeeze.Color("Loose Squeeze")
else Squeeze.Color("No Squeeze")
);
Squeeze.HideTitle();
Squeeze.HideBubble();
AddLabel(
showLabel,
if currentAggPeriod == AggregationPeriod.WEEK then " W "
else if currentAggPeriod == AggregationPeriod.DAY then " D "
else if currentAggPeriod == AggregationPeriod.HOUR then " H "
else if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then " 15 "
else if currentAggPeriod == AggregationPeriod.FIVE_MIN then " 5 "
else if currentAggPeriod == AggregationPeriod.TWO_MIN then " 2 "
else " ",
if Moxie < 0 then Color.RED else Color.GREEN
);
AddLabel(
yes,
if currentAggPeriod == AggregationPeriod.WEEK then " W "
else if currentAggPeriod == AggregationPeriod.Day then " D "
else if currentAggPeriod == AggregationPeriod.HOUR then " H "
else if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then " 15 "
else if currentAggPeriod == AggregationPeriod.FIVE_MIN then " 5 "
else if currentAggPeriod == AggregationPeriod.TWO_MIN then " 2 "
else " ",
if Moxie < 0 then Color.RED else Color.GREEN
);
Running the moxie lwr smooth for two days and it seems to mirror my wave lines on the 10 min chart the shorter time frames have been profitable.
What are the red down arrows above/green below the zero line?
@Slippage. That is a great idea? Actually clearer than the trampoline dots. Please let me know when you have been satisfied with the observation results as I’d love to try the code when ready. I admire your sticktoitness.That's my new way to show trampolines since I'm using squeeze dots on the zero line. It needs more work, though. The arrow tips cover the squeeze dots if I position the arrows at 0. So I have to offset them a bit. Moxie's range is different on every symbol and every timeframe so if I hard code a specific offset sometimes it's perfect, sometimes not enough and sometimes way too much. So, I changed it to calculate the offset dynamically. It's working better but still needs some tweaking.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
T | Repaints Moxie for ThinkorSwim | Indicators | 155 | |
Z-Score Probability Indicator for ThinkOrSwim | Indicators | 29 | ||
HTF PO3 Indicator For ThinkOrSwim | Indicators | 37 | ||
N | RSI - TSI Indicator For ThinkOrSwim | Indicators | 33 | |
Turtle Trade Channels Indicator(TuTCI) for ThinkOrSwim | Indicators | 32 |
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.