TMA Discussion Thread

Post Reply
garyfritz

Re: TMA Discussion Thread

Post by garyfritz »

From that post: I wonder if this is the cause of the changing values in the "true" version?

Code: Select all

if ( ignoreFuture )
      {
         dblTma = calcTmaTrue( symbol, tf, shift );
         dblPrev = calcPrevTrue( symbol, tf, shift );
      }

...and those calc functions are defined as:

double calcTmaTrue( string symbol, int tf, int inx )
{
   return ( iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, inx ) );
}

double calcPrevTrue( string symbol, int tf, int inx )
{
   double dblSum  = iClose( symbol, tf, inx + 1 ) * 21;
   double dblSumw = 21;
   int jnx, knx;
   
   dblSum  += iClose( symbol, tf, inx ) * 20;
   dblSumw += 20;
         
   for ( jnx = 1, knx = 20; jnx <= 20; jnx++, knx-- )
   {
      dblSum  += iClose( symbol, tf, inx + 1 + jnx ) * knx;
      dblSumw += knx;
   }
   
   return ( dblSum / dblSumw );
}
So calcTmaTrue calls the LWMA, which I think weights bar inx as 21, inx+1 as 20, etc.

Then calcPrevTrue weights bar inx with weight 20, bar inx+1 with weight 21, bar inx+2 with weight 20, etc.

That's not an accurate calculation for the previous TMA value. It shouldn't have bar inx with weight 20 in it.

Instead of

dblTma = calcTmaTrue( symbol, tf, shift );
dblPrev = calcPrevTrue( symbol, tf, shift );

why not do this?

dblTma = calcTmaTrue( symbol, tf, shift );
dblPrev = calcTmaTrue( symbol, tf, shift+1 );

That would give dblPrev the accurate previous value of the TmaTrue.
User avatar
NeoTrader
Trader
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: TMA Discussion Thread

Post by NeoTrader »

hy gary,
garyfritz wrote:why not do this?

dblTma = calcTmaTrue( symbol, tf, shift );
dblPrev = calcTmaTrue( symbol, tf, shift+1 );

That would give dblPrev the accurate previous value of the TmaTrue.
hehe...if it where that simple...;)

just because I'm a curious Individual I tested it for you... and this is the result...
tma test comparison gary1.png

I also tried/played with different variations and actually the current version is the closest thing that was acceptable from my point of view...and still can be called tma.. It has the same values in the current bar as the TMA and also shows the angle in a clean manner but more compressed and much closer to real time data than the original version.

In my understanding of the TMA slope in it's original version the Intention is, that not only the current value of the bar is important to the trader but also the angle of the slope that gives a kind of prediction where the development of the slope is going. Or better described how strong/weak the next bar could become.

NB also describes it in his documentation that the stronger the angle is the stronger the move becomes and vice versa.

happy trading

NeoTrade

-
You do not have the required permissions to view the files attached to this post.
User avatar
Baluda
Trader
Posts: 330
Joined: Mon Feb 06, 2012 2:00 pm
Location: An insignificant village in the Netherlands

Re: TMA Discussion Thread

Post by Baluda »

garyfritz wrote:Instead of

dblTma = calcTmaTrue( symbol, tf, shift );
dblPrev = calcPrevTrue( symbol, tf, shift );

why not do this?

dblTma = calcTmaTrue( symbol, tf, shift );
dblPrev = calcTmaTrue( symbol, tf, shift+1 );
Because the result would be a LWMA slope instead of a TMA slope.

Paul
Check the MQL4 Market for my best EA's and Indicators.
fxlight
Trader
Posts: 18
Joined: Fri Nov 18, 2011 9:36 am

Re: TMA Discussion Thread

Post by fxlight »

Baluda, Neo,
can you smooth out TmaSlopeTrue a little with SMA/EMA? Or is it nonsense?
fl
User avatar
NeoTrader
Trader
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: TMA Discussion Thread

Post by NeoTrader »

hi fxlight
fxlight wrote:Baluda, Neo,
can you smooth out TmaSlopeTrue a little with SMA/EMA? Or is it nonsense?
fl
It would be nonsense..;)

We are discussing here against changing the past values to have at least the possibility to do some visual back testing...at least one fraction is against the smoothening...;)

happy trading,

NeoTrader

-
fxlight
Trader
Posts: 18
Joined: Fri Nov 18, 2011 9:36 am

Re: TMA Discussion Thread

Post by fxlight »

Neo,
I understand. It is like linear regression. We are looking at current curve (for non fx example). We do not need past values. But fx trader want to see real past values. Not every trader. TmaSlopeTrue is not a very nice curve. So... LOL
happy trading
User avatar
NeoTrader
Trader
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: TMA Discussion Thread

Post by NeoTrader »

hi fxlight
fxlight wrote:We do not need past values.
But fx trader want to see real past values. Not every trader.
If we want to do quick visual backtest...we need accurate past values and not only FX traders needs them.
On the other Hand you can switch anytime to the beautiful original TMA slope...it is only 1 parameter away..;)
fxlight wrote:TmaSlopeTrue is not a very nice curve. So...
I don't need nice curves... I need accurate curves that resembles the real time values of the past bars.
A nice curve brings nothing on the table besides that it looks nice...the information it delivers is faulty.

happy trading,

NeoTrader

-
fxlight
Trader
Posts: 18
Joined: Fri Nov 18, 2011 9:36 am

Re: TMA Discussion Thread

Post by fxlight »

thanks, Neo, for your answers.

nice weekend
fl
nonlinear
Trader
Posts: 293
Joined: Fri Jun 01, 2012 2:56 pm
Location: Washington DC

Re: TMA Discussion Thread

Post by nonlinear »

Good stuff in this thread. I have been forward testing 10.2, but the inability to review past trades in view of the realtime TMA values is a real pain. Thanks everyone.
nonlinear
Trader
Posts: 293
Joined: Fri Jun 01, 2012 2:56 pm
Location: Washington DC

Re: TMA Discussion Thread

Post by nonlinear »

I loaded 10.2 TMAslopetrue on all my charts and have been watching the real time values, which look identical to 10.2 TMASlope. The ability to now visually back test is great.
Post Reply

Return to “Nanningbob 10.x”