Moxie Indicator for ThinkorSwim

tradegeek

Active member
2019 Donor
VIP
I don't know if anyone has come across this neat indicator called the "Moxie Indicator". It seems the creator of this indicator has it developed for Ninjatrader and Thinkorswim but he's not releasing the TOS version because he doesn't want the code shared. He has partnered up with John Carter from SimplerTrading to provide alerts based on this indicator.

You can check it out here...

It would be nice if something like this can be replicated. I am not a programmer so I wouldn't know where to start. Can it be reversed engineered from a NinjaTrader script?

Much success to all!

Edit #1: @diazlaz converted a TradingView script that mimicked the Moxie script: https://usethinkscript.com/threads/moxie-indicator-for-thinkorswim.369/post-36862

Edit #2: Check out @Slippage version of the Moxie Indicator here: https://usethinkscript.com/threads/moxie-indicator-for-thinkorswim.369/post-53789

Edit #3: @Slippage reviews of the paid Moxie indicator https://usethinkscript.com/threads/moxie-indicator-for-thinkorswim.369/post-53751
 

Slippage

Active member
Hi is there a way to scan for divergence in the MOXIE to PRICE ?

No, it's not possible. I doubt the real Moxie indicator has such a scan either since it has no visual to cues for divergence. I played with visuals for a few minutes weeks ago using code I stole from a Mobius RSI Divergence study but it didn't work very well so I scrapped it.
 

New Indicator: Buy the Dip

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.

Download the indicator

VickyVJ

New member
VIP
The second line for 15m timeframe is already included in the code I posted. You just need to check the box to turn on that plot on 15m charts.

Yours looks like it's drawing fine. On 15m Watkins uses two higher timeframes to draw two different Moxie lines, 1-hour and 2-hour. And he's using the high instead of closing price only on 15m timeframe. So if that's what you implemented then it's correct.
Hi Slippage, thank u very much on the indicator. i have installed and set the chart to 15mins but i do not see the second line in the lower studies. I wanted to insert a picture of my chart for purview but didnt know how to. Is there certain settings i need to set for the second line to appear? Thank u in advance
 

Slippage

Active member
Hi Slippage, thank u very much on the indicator. i have installed and set the chart to 15mins but i do not see the second line in the lower studies. I wanted to insert a picture of my chart for purview but didnt know how to. Is there certain settings i need to set for the second line to appear? Thank u in advance

In the settings for the lower study, on the MoxieSecondLine tab, check the box that says "Show plot".
 

Slippage

Active member
@Slippage...excellent reproduction of Moxie. I have a question. I have noticed the arrows ranging from one to eight when they appear, is there any significance to this? Does it indicate the strength of the signal or something else?

The number of arrows depends on how many of your current timeframe fit into the higher timeframe Moxie is using to calculate its plot. On daily you'll get 5 arrows for the week. On hourly, you'll get 8 arrows for the day, etc.
 

Alb

New member
Here's my final code all cleaned up. Since Watkins only uses the second line on 15m charts, in order to avoid impacting performance on other timeframes I made it use the current timeframe's data to calculate the second line. The second line is useless now on other timeframes. It will be the same as first line. If we're following the Moxie strategy we don't need the second line on other timeframes anyway.

When you're switching through symbols and trying to scan with your eyes across multiple charts quickly the zero line can be hard to notice when it's at the top or bottom. I added a label to the lower study so it's easier to see, at a glance, if a particular timeframe is above (green) or below (red) zero. I was thinking about also creating an MTF study to add labels for higher timeframes so if you're maximized on the 1H chart you can still see if Moxie is above zero on D and W charts.

That said, I'm setting Moxie aside for now while I do some testing with a Squeeze Pro clone. I'm keeping the Moxie lower study on my charts for now as the only visible momentum indicator since I've customized Squeeze Pro to give signal arrows when both its built in momentum and the TTM_Wave move together in the same direction. I may or may not keep Moxie along with Squeeze Pro depending on if it's redundant or if it's later to correctly signal direction changes.

Here's the Moxie upper study for the arrows
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 price =
  if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN then high(period = higherAggPeriod)
  else close(period = higherAggPeriod)
;
def Moxie = MoxieFunc(price);

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();

And here's the Moxie lower study
Ruby:
declare lower;

input showVerticalLines = yes;
input showTrampolines = yes;

plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.GRAY);
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;
}

# Watkins uses the high for 15m charts and the close for other timeframes
def price =
  if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN
  then high(period = higherAggPeriod)
  else close(period = higherAggPeriod)
;

plot Moxie = MoxieFunc(price);
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.
# We'll hide the second Moxie line by default. You should enable it
# on 15 minute charts.
# 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
  # on the next line it seems like we should be able to use AggregationPeriod.TWO_HOURS
  # instead of the secondAggPeriod variable holding that value but for some reason that
  # causes the main Moxie plot on 1 hour chart to render nothing.
  then MoxieFunc(high(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.Hide();

# Show vertical lines at crossovers
AddVerticalLine(showVerticalLines and Moxie[1] <= 0 and Moxie > 0, "", CreateColor(0,150,0), Curve.SHORT_DASH);
AddVerticalLine(showVerticalLines and Moxie[1] >= 0 and Moxie < 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();

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 Moxie < 0 then Color.RED else Color.GREEN
);
Hi Slippage,
Just noticed your contributions as I had recently seen a Simpler Trading / TG marketing video and was curious as to what Moxie indi really was...

So thanks very much for all your effort in sleuthing and coding and testing...

You may be aware of this, but just for the general knowledge, in looking at your code, MoxieFunc() seems really just to be a slight variant on MACD Histogram, otherwise known as OsMA or Oscillator of Moving Averages using the standard OsMA periods (12, 26, 9) and MA methods (Exp, Exp, Sma), but instead using the next Higher Time Frame to give the staircase effect (and make the changes more visually dramatic and reflective of the HTF MACD C/D's) and 2 colored line rather than single/dual or 4 color histograms which are generally used. And on 15min (and lower) TF uses next 2 HTFs (and price of High rather than Close as you have discovered).

The unique Moxie parts seem to be identifying the HTF "trampoline" OsMA and 50/200 MA relationships and use of HTF slope colored line to make easy to quickly see trend direction and crosses.

A few minor things I notice in your code:
  • uses Exp MA method for the MACD smoothing/signal (ie def va1 = ExpAverage(vc1, 9); should it be Sma?)
  • only uses the 2 HTFs for the 15min TF ( ie if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN; should it be 15min and lower TFs?)

Nicely done!
 
Last edited:

tm454

New member
guys I was watching several videos on this Moxie indicator itreally works in showing divergence an entry signals on the 60 min if the daily is align in trend if someone can get this script will be great
Lol just because they cherry-picked a few examples for you, that doesn't mean it works. Did they show you their account or P/L statements? Of course not.
 
Lol just because they cherry-picked a few examples for you, that doesn't mean it works. Did they show you their account or P/L statements? Of course not.
Hi all, I actually own the original Moxie indicator and I'm in his paid trading room. He HAS shown his account balances. He is very transparent about that stuff. He is also honest when things don't work and where he is wrong. He teaches us what to look for.

The point I'm trying to make is that his indicator works, but you should study his strategy. He doesn't enter trades when his indicator fires. There is a set of rules that have to be met before a trade is taken. The indicator is just a guide.
 

Slippage

Active member
A few minor things I notice in your code:
  • uses Exp MA method for the MACD smoothing/signal (ie def va1 = ExpAverage(vc1, 9); should it be Sma?)
  • only uses the 2 HTFs for the 15min TF ( ie if currentAggPeriod == AggregationPeriod.FIFTEEN_MIN; should it be 15min and lower TFs?)

The code in MoxieFunc predates my efforts on this. That part was posted earlier in this thread before I joined the effort and it was copied/ported from TradingView, if I remember correctly. The code posted before I joined was very close to real Moxie, with just (arguably better) different line coloring and the calculation for the second line on 15m wasn't correct. Fixing that was my main contribution.

My intention was to replicate the real Moxie's behavior exactly. The existing formula seems to do that and so does the choice of using 2 lines only on 15m charts. In some videos you can see Watkins does have 5m and 2m charts that are rarely within the view of the recording and he isn't using two lines on those. He doesn't trade those timeframes and very rarely mentions them in his videos though he did state he has some customers day trading on those with Moxie.

The trampoline indication and vertical lines at crossovers were enhancements I added that the original Moxie doesn't include. I added the inputs to enable/disable them so it's easy to turn them off and have the same experience as the real Moxie indicator if that's what someone wants.
 

Slippage

Active member
Hi all, I actually own the original Moxie indicator and I'm in his paid trading room. He HAS shown his account balances. He is very transparent about that stuff. He is also honest when things don't work and where he is wrong. He teaches us what to look for.

@Homemadeitmyself Do you have the Mastery subscription or one of the training packages? Is Mastery just trade signals and once a month live sessions? Or is there a chat room and more resources to help actually learn the strategy? I've watched a lot of his videos and I've mostly reverse engineered his strategy from those but I'm wondering if the training would be worthwhile anyway.

I noticed with the way they price the 4 or 5 hour training session the best value is to pay for the basic level training and then pay for one quarter of Mastery. That's the same price as paying for the Elite training and you get 3 months of trade signals while losing just one of the four live trading sessions from Elite.
 
Last edited:

Slippage

Active member
The point I'm trying to make is that his indicator works, but you should study his strategy. He doesn't enter trades when his indicator fires. There is a set of rules that have to be met before a trade is taken. The indicator is just a guide.

I've been trying to convey that the indicator is not the strategy and that jumping into a trade when you see the arrows is going to lose money but people don't like to read that part.

I watched videos on his MoxieTrader channel, which was before he joined Simpler, and videos from different times after he joined Simpler. From those different time periods you can see his strategy mature and get more conservative about entries.

It's a little amusing how popular this thread has suddenly become right after Watkins had his first million dollar day and the ensuing marketing push from Simpler about it.
 

Alb

New member
The code in MoxieFunc predates my efforts on this. That part was posted earlier in this thread before I joined the effort and it was copied/ported from TradingView, if I remember correctly. The code posted before I joined was very close to real Moxie, with just (arguably better) different line coloring and the calculation for the second line on 15m wasn't correct. Fixing that was my main contribution.

My intention was to replicate the real Moxie's behavior exactly. The existing formula seems to do that and so does the choice of using 2 lines only on 15m charts. In some videos you can see Watkins does have 5m and 2m charts that are rarely within the view of the recording and he isn't using two lines on those. He doesn't trade those timeframes and very rarely mentions them in his videos though he did state he has some customers day trading on those with Moxie.

The trampoline indication and vertical lines at crossovers were enhancements I added that the original Moxie doesn't include. I added the inputs to enable/disable them so it's easy to turn them off and have the same experience as the real Moxie indicator if that's what someone wants.
Thanks for the explanation, and your observations of TG's group. It seemed to me in watching his marketing video that he was just using Moxie as one of the inputs along with squeeze, stochastics, volume and 4 MAs on 3 timeframes to get a sense as to whether whichever entity he was looking at was getting ready to explode, and if so buy underlying or use options along with take profit / exit points to create a winning strategy. Since he was looking for wins in days-weeks, the lag on the 15min didn't seem to be relevant. I like this strategy :) But the main benefit I would think for most would be the group dynamics and suggestions on what entities seem ready to explode.
And the results he has had recently seem to be quite spectacular. To use this to day trade though is a different matter all together.

Btw, I only provided my comments on Moxie relation to OsMA and code snippets since I thought you might like the feedback...
 

Slippage

Active member
Thanks for the explanation, and your observations as being a member in TG's group. It seemed to me in watching his marketing video that he was just using Moxie as one of the inputs along with squeeze, stochastics, volume and 4 MAs on 3 timeframes to get a sense as to whether whichever entity he was looking at was getting ready to explode, and if so buy underlying or use options along with take profit / exit points to create a winning strategy. Since he was looking for wins in days-weeks, the lag on the 15min didn't seem to be relevant. I like this strategy :) But the main benefit I would think for most would be the group dynamics and suggestions on what to entities seem ready to explode.
And the results he has had recently seem to be quite spectacular. To use this to day trade though is a different matter all together.

Btw, I only provided my comments on Moxie relation to OsMA and code snippets since I thought you might like the feedback...

I'm not in his group yet but I may join. You can find lots of his videos on the Simpler Trading channel on YouTube and he has a Moxie Trader channel on YouTube, where he's a bit less secretive, from before he joined Simpler Trading.

If you watch more of his videos you'll find Squeeze didn't exist on his charts before he joined Simpler Trading and I believe it's there primarily to market SqueezePro. His strategy doesn't depend on squeeze at all though he does occasionally mention it if he happens to notice the stock he's looking at is in a squeeze in addition to meeting his strategy's criteria. He specifically stated he rarely uses the stochastics. In the dozens of videos I've watched he's never referred to volume except in a case where someone asked him to look at a stock and he mentioned it's too low volume. It was 200k for the day or something like that.

My impression is his strategy is almost entirely based on the 1 hour chart's MAs and price action. D/W/M MAs are filters to avoid immediate overhead resistance. 15m charts are just for tighter entries. And then Moxie on all those timeframes as a filter (above/below zero) and for divergence. I need to pay closer attention to see if he's even really watching Moxie on weekly. I believe his strategy can be reduced to just 3 charts, D/H/15m, if you select stocks from a scan that avoids the higher timeframe MAs or plot the weekly and monthly MAs on your D/H/15 charts so you won't need to refer to M and W.

Regarding your comments on OsMA, I appreciate that. I figured Moxie was based on something already well known and I was curious what it is but I hadn't taken any time to dig into it. Watkins seems like a smart guy. He graduated as a mechanical engineer so he must be able to do some math. But he doesn't strike me as the mathemagician type who would be capable of inventing something completely new and useful.
 
Last edited:

Alb

New member
I'm not in his group yet but I may join. You can find lots of his videos on the Simpler Trading channel on YouTube and he has a Moxie Trader channel on YouTube, where he's a bit less secretive, from before he joined Simpler Trading.

If you watch more of his videos you'll find Squeeze didn't exist on his charts before he joined Simpler Trading and I believe it's there primarily to market SqueezePro. His strategy doesn't depend on squeeze at all though he does occasionally mention it if he happens to notice the stock he's looking at is in a squeeze in addition to meeting his strategy's criteria. He specifically stated he rarely uses the stochastics. In the dozens of videos I've watched he's never referred to volume except in a case where someone asked him to look at a stock and he mentioned it's too low volume. It was 200k for the day or something like that.

My impression is his strategy is almost entirely based on the 1 hour chart's MAs and price action. D/W/M MAs are filters to avoid immediate overhead resistance. 15m charts are just for tighter entries. And then Moxie on all those timeframes as a filter (above/below zero) and for divergence. I need to pay closer attention to see if he's even really watching Moxie on weekly. I believe his strategy can be reduced to just 3 charts, D/H/15m, if you select stocks from a scan that avoids the higher timeframe MAs or plot the weekly and monthly MAs on your D/H/15 charts so you won't need to refer to M and W.

Regarding your comments on OsMA, I appreciate that. I figured Moxie was based on something already well known and I was curious what it is but I hadn't taken any time to dig into it. Watkins seems like a smart guy. He graduated as a mechanical engineer so he must be able to do some math. But he doesn't strike me as the mathemagician type who would be capable of inventing something completely new and useful.
I have only watched 1 or 2 of his videos, so don't have anywhere as much depth of knowledge on his strategy as you, but from those I totally concur, particularly on squeeze. It seems Daily and above MAs are for key S/R and trends of higher TFs. But with focus on days-weeks investment, so getting good entries using hourly and 15min to optimize entries makes sense. He mentioned pulling trigger in last hour of day, so this would align too. One concept he mentioned wrt 15min that seemed interesting though was if the 1hr and 2hr moxies separate that this indicates weak move. I am looking into the math/stat's a bit to see if that holds up, since if it does that could be interesting as well. Cheers.
 

Slippage

Active member
I have only watched 1 or 2 of his videos, so don't have anywhere as much depth of knowledge on his strategy as you, but from those I totally concur, particularly on squeeze. It seems Daily and above MAs are for key S/R and trends of higher TFs. But with focus on days-weeks investment, so getting good entries using hourly and 15min to optimize entries makes sense. He mentioned pulling trigger in last hour of day, so this would align too. One concept he mentioned wrt 15min that seemed interesting though was if the 1hr and 2hr moxies separate that this indicates weak move. I am looking into the math/stat's a bit to see if that holds up, since if it does that could be interesting as well. Cheers.

Yes, he does often mention a strong preference for the two lines on 15m to be "in agreement" with each other. Another unknown I've been watching for is how far from zero should Moxie be for a trampoline setup to be valid or some other criteria for trampolines. You'll often see trampoline conditions as Moxie approaches the zero line to cross over and they fail quickly.
 

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

Similar threads

Top