Coding the Moxie indicator for Wave59, help appreciated...
Posted: Sun Mar 07, 2021 9:44 pm
I'd really like to get the Moxie indicator working for Wave59, judging by online feedback. many of its users seem to have had great results using it.
The code reads fairly simply and is open source on thinkorswim, and the ubiquitous tradingview online charting platform
This script plots a form of momentum using data from higher time frames
The indicator seems to grab bars from the next highest timeframe, I'm using daily charts, so this would be weekly bars.
In thinkorswim the tricky line of code is:
"if currentAggPeriod <= AggregationPeriod.DAY then AggregationPeriod.WEEK"
Code is here:
https://usethinkscript.com/threads/moxi ... post-53789
and here:
https://www.tradingview.com/script/mssQ ... ows-Salty/
I'm trying to figure this out by pulling the weekly close from the previous fridays close, I was thinking along the lines of a counter that counts to five (to simulate Friday close on a five day trading week), then every time it counts to five it adds a value to an array that the 'moxiefunc' function makes use of.
This is as far as I got:
(Here is the 'moxiefunc' function the Moxie indicator references)
#returns moxiefunc
input: price;
vc1=xaverage(price, 12) - xaverage(price , 26);
va1=xaverage(vc1, 9);
plotdata = (vc1-va1)*3;
return plotdata;
(Moxie indicator)
input:lookback(5);
if (barnum==barsback)
{
longArrowPosition=low;
}
Moxie = MoxieFunc(close[lookback]);
if (Moxie > 0 and Moxie[1] <= 0)
{
longTrigger = Moxie;
}
else
{
longTrigger = false;
}
if (Moxie==longTrigger) and (Moxie != Moxie[1])
{
longArrowPosition=low;
}
else if (Moxie==longTrigger) and (Moxie==Moxie[1])
{
longArrowPosition=longArrowPosition[1];
}
plot1=longArrowPosition;
This is what my plot looks like:
Here are some examples of what it should look like.
Any help figuring this out would be most appreciated
I'm sure there will be an easy way for Wave59 to do this. Anyway for the type of trading I do Wave59 leaves these other platforms in the dust, nothing else comes close. Just a different reality bubble...
The code reads fairly simply and is open source on thinkorswim, and the ubiquitous tradingview online charting platform
This script plots a form of momentum using data from higher time frames
The indicator seems to grab bars from the next highest timeframe, I'm using daily charts, so this would be weekly bars.
In thinkorswim the tricky line of code is:
"if currentAggPeriod <= AggregationPeriod.DAY then AggregationPeriod.WEEK"
Code is here:
https://usethinkscript.com/threads/moxi ... post-53789
and here:
https://www.tradingview.com/script/mssQ ... ows-Salty/
I'm trying to figure this out by pulling the weekly close from the previous fridays close, I was thinking along the lines of a counter that counts to five (to simulate Friday close on a five day trading week), then every time it counts to five it adds a value to an array that the 'moxiefunc' function makes use of.
This is as far as I got:
(Here is the 'moxiefunc' function the Moxie indicator references)
#returns moxiefunc
input: price;
vc1=xaverage(price, 12) - xaverage(price , 26);
va1=xaverage(vc1, 9);
plotdata = (vc1-va1)*3;
return plotdata;
(Moxie indicator)
input:lookback(5);
if (barnum==barsback)
{
longArrowPosition=low;
}
Moxie = MoxieFunc(close[lookback]);
if (Moxie > 0 and Moxie[1] <= 0)
{
longTrigger = Moxie;
}
else
{
longTrigger = false;
}
if (Moxie==longTrigger) and (Moxie != Moxie[1])
{
longArrowPosition=low;
}
else if (Moxie==longTrigger) and (Moxie==Moxie[1])
{
longArrowPosition=longArrowPosition[1];
}
plot1=longArrowPosition;
This is what my plot looks like:
Here are some examples of what it should look like.
Any help figuring this out would be most appreciated
I'm sure there will be an easy way for Wave59 to do this. Anyway for the type of trading I do Wave59 leaves these other platforms in the dust, nothing else comes close. Just a different reality bubble...