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.
I never tried it on mobile until a week ago. I found it doesn't plot anything. Neither does the real Moxie code from Simpler Trading. I suspect accessing secondary timeframes may not be allowed on mobile but I haven't looked into it.Hi does anyone have mobile version of the moxie indicator script ?
What does the trampoline show?
ThanksThe guy who created Moxie says if Moxie is above zero and price closes below SMA 50 then price should bounce. He calls it the trampoline setup. The inverse also applies for shorting.
Does the Moxie indicator work on tick charts?
The guy who created Moxie says if Moxie is above zero and price closes below SMA 50 then price should bounce. He calls it the trampoline setup. The inverse also applies for shorting.
The moxie is just the macd...literally nothing else. Its the macd histogram one time aggregation higher. I. even saw their coding and they put fake lines of code and formulas in to throw people off the scent of the fact that its just plotting the macd hist as a line... No need to backtest, you either like using the macd or you dont.can anyone code a strategy that backtest Moxie indicator, go long when Moxie line goes above 0, and go short when it goes below 0? Thanks! No idea how to code this backtest strategy
Wondering if anyone can modify this code to work in the mobile app version of TOSHopefully this will be the final code. The code for the scans have not changed since they were posted earlier. I just wanted to bring all the pieces together in this post as the (hopefully) final and complete package.
1. This resolves a bug for 15m. It should use close price rather than high price.
2. This makes it so the second line is shown by default on 15m and no other timeframes. I changed this to stop the confusion some members ran into with why the second line didn't appear automatically on 15m.
Moxie Upper:
Ruby:declare upper; def currentAggPeriod = GetAggregationPeriod(); def higherAggPeriod = if currentAggPeriod <= AggregationPeriod.TWO_MIN then AggregationPeriod.FIVE_MIN else if currentAggPeriod <= AggregationPeriod.THREE_MIN then AggregationPeriod.TEN_MIN else if currentAggPeriod <= AggregationPeriod.FIVE_MIN then AggregationPeriod.FIFTEEN_MIN else if currentAggPeriod <= AggregationPeriod.TEN_MIN then AggregationPeriod.THIRTY_MIN else if currentAggPeriod <= AggregationPeriod.FIFTEEN_MIN then AggregationPeriod.HOUR else if currentAggPeriod <= AggregationPeriod.THIRTY_MIN then AggregationPeriod.TWO_HOURS else if currentAggPeriod <= AggregationPeriod.TWO_HOURS then AggregationPeriod.DAY else if currentAggPeriod <= AggregationPeriod.FOUR_HOURS then AggregationPeriod.TWO_DAYS else if currentAggPeriod <= AggregationPeriod.DAY then AggregationPeriod.WEEK else if currentAggPeriod <= AggregationPeriod.WEEK then AggregationPeriod.MONTH else AggregationPeriod.QUARTER ; script MoxieFunc { input price = close; def vc1 = ExpAverage(price, 12) - ExpAverage(price , 26); def va1 = ExpAverage(vc1, 9); plot data = (vc1 - va1) * 3; } def Moxie = MoxieFunc(close(period = higherAggPeriod)); def longTrigger = if Moxie > 0 and Moxie[1] <= 0 then Moxie else Double.NaN; def longArrowPosition = # first arrow if Moxie == longTrigger and Moxie != Moxie[1] then low # consecutive arrows at same position else if Moxie == longTrigger and Moxie == Moxie[1] then longArrowPosition[1] else Double.NaN; plot long = longArrowPosition; long.SetPaintingStrategy(PaintingStrategy.ARROW_UP); long.SetDefaultColor(Color.GREEN); long.SetLineWeight(3); long.HideBubble(); long.HideTitle(); def shortTrigger = if Moxie < 0 and Moxie[1] >= 0 then Moxie else Double.NaN; def shortArrowPosition = # first arrow if Moxie == shortTrigger and Moxie != Moxie[1] then high # consecutive arrows at same position else if Moxie == shortTrigger and Moxie == Moxie[1] then shortArrowPosition[1] else Double.NaN; plot short = shortArrowPosition; short.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); short.SetDefaultColor(Color.LIGHT_RED); short.SetLineWeight(3); short.HideBubble(); short.HideTitle();
Moxie Lower:
Ruby:declare lower; input showVerticalLines = yes; input showTrampolines = yes; input showSqueezeDots = no; plot ZeroLine = if !IsNaN(open) and !showSqueezeDots then 0 else Double.NaN; ZeroLine.SetDefaultColor(Color.GRAY); ZeroLine.SetLineWeight(2); ZeroLine.HideBubble(); ZeroLine.HideTitle(); def currentAggPeriod = GetAggregationPeriod(); def higherAggPeriod = if currentAggPeriod <= AggregationPeriod.TWO_MIN then AggregationPeriod.FIVE_MIN else if currentAggPeriod <= AggregationPeriod.THREE_MIN then AggregationPeriod.TEN_MIN else if currentAggPeriod <= AggregationPeriod.FIVE_MIN then AggregationPeriod.FIFTEEN_MIN else if currentAggPeriod <= AggregationPeriod.TEN_MIN then AggregationPeriod.THIRTY_MIN else if currentAggPeriod <= AggregationPeriod.FIFTEEN_MIN then AggregationPeriod.HOUR else if currentAggPeriod <= AggregationPeriod.THIRTY_MIN then AggregationPeriod.TWO_HOURS else if currentAggPeriod <= AggregationPeriod.TWO_HOURS then AggregationPeriod.DAY else if currentAggPeriod <= AggregationPeriod.FOUR_HOURS then AggregationPeriod.TWO_DAYS else if currentAggPeriod <= AggregationPeriod.DAY then AggregationPeriod.WEEK else if currentAggPeriod <= AggregationPeriod.WEEK then AggregationPeriod.MONTH else AggregationPeriod.QUARTER ; script MoxieFunc { input price = close; def vc1 = ExpAverage(price, 12) - ExpAverage(price , 26); def va1 = ExpAverage(vc1, 9); plot data = (vc1 - va1) * 3; } plot Moxie = MoxieFunc(close(period = higherAggPeriod)); Moxie.SetLineWeight(2); Moxie.DefineColor("Up", Color.GREEN); Moxie.DefineColor("Down", Color.RED); def lastChange = if Moxie < Moxie[1] then 1 else 0; Moxie.AssignValueColor( if lastChange == 1 then Moxie.Color("Down") else Moxie.Color("Up") ); # Watkins uses a different setup for Moxie on his 15 minute charts. # He uses two lines derived from two higher timeframes. # For timeframes other than 15 minutes we'll use the same data as # first Moxie line to reduce data requested from the server and # improve performance. def secondAggPeriod = if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then AggregationPeriod.TWO_HOURS else currentAggPeriod ; plot MoxieSecondLine = if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then MoxieFunc(close(period = secondAggPeriod)) else Double.NaN ; MoxieSecondLine.SetLineWeight(2); MoxieSecondLine.DefineColor("Up", Color.GREEN); MoxieSecondLine.DefineColor("Down", Color.RED); def lastChangeSecondLine = if MoxieSecondLine < MoxieSecondLine[1] then 1 else 0; MoxieSecondLine.AssignValueColor( if lastChangeSecondLine == 1 then MoxieSecondLine.Color("Down") else MoxieSecondLine.Color("Up") ); 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 bb = reference BollingerBands.LowerBand; def squeezeLevel = if bb > KeltnerChannels(factor = 1.0).Lower_Band then 3 else if bb > KeltnerChannels(factor = 1.5).Lower_Band then 2 else if bb > KeltnerChannels(factor = 2.0).Lower_Band then 1 else 0 ; plot Squeeze = if !showSqueezeDots then Double.NaN else if !IsNaN(open) then 0 else Double.NaN; 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.SetLineWeight(2); Squeeze.HideTitle(); Squeeze.HideBubble(); 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 );
Trigger scan:
Ruby:# because Moxie calculates from higher time frame # to find daily entries, run this scan on weekly # to find hourly entries, run this on daily script Moxie { input priceC = close; def vc1 = ExpAverage(priceC , 12) - ExpAverage(priceC , 26); def va1 = ExpAverage(vc1, 9); plot sData = (vc1 - va1) * 3; } def m = Moxie(); def moxieUpArrow = m > 0 and m[1] <= 0; plot scan = moxieUpArrow within 1 bars;
Trampoline scan from @Sneaky_Swings earlier in this thread:
Ruby:# because Moxie calculates from higher time frame # to find daily entries, run this scan on weekly # to find hourly entries, run this on daily def ap1 = close; script MoxieFunc { input priceC = close; def vc1 = ExpAverage(priceC , 12) - ExpAverage(priceC , 26); def va1 = ExpAverage(vc1, 9); plot sData = (vc1 - va1) * 3; } def price = close; def s2 = MoxieFunc(price); def ZeroLine = 0; def Moxie = s2; # Indicate the Trampoline setup def sma50 = SimpleMovingAvg(close, 50); plot trampoline = (Moxie > 0.1 and close < sma50);
EDIT 3/1/21 to add squeeze dots on zero line
The indicators on this forum were created for the ToS desktop app.Wondering if anyone can modify this code to work in the mobile app version of TOS
Been looking everywhere and no luck
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.