[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: TTMSqueeze, TTMTrend indicators



PureBytes Links

Trading Reference Links

Linear Regression indicator is used to smooth the price data  - 
similar to MA, EMA, DEMA, JMA and many others.  LR has its own
advantages and disadvantages of lag, noise reduction and smoothing.

Using the same mathematical technology you can do a best fit to
basically any equation  -  linear, quadratic, cubic  .  .  . 
For example Tomasz just added Fourier Transform, which fits data to a
series of weighted sine waves.

Finally I would like to note that what is implicit in all of this is
that there is some information hidden in the recent price data that
will predict future prices.  While that is occasionally true (maybe
just randomly true) I'm not sure it is reliably predictive.

ReefBreak


--- In amibroker@xxxxxxxxxxxxxxx, "gunovanengel" <gunovanengel@xxx> wrote:
>
> --Here is my question: why are they using LinearReg to smoothen a
> curve; 
> 
> I have no clue
> 
> Regards
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "chetan_gariki" <chetan_gariki@> 
> wrote:
> >
> > Thanks Guno. The Heikin ashi is good; but there is something fishy 
> > with the other ttmsqueeze indicator. in any case, i kind of played 
> > with it for a while (a few days :() and have a good version. There 
> is 
> > one problem though. Take a look at this picture 
> > first:http://www.flickr.com/photos/7150208@xxx/406220699/
> > 
> > Now i pretty much have a good idea of entry point, but to get a 
> good 
> > exit point i need the histogram to be smoother. The way they 
> actually 
> > recommend it on Tradethemarket website is that they use a moving 
> > average of the 12day-mmomentum but that is not correct (they use 
> > something else); but they actually appear to have copied the idea 
> > from the tradestation messageboard. on there they actually say that 
> > they are plotting a delta of the difference between the Donchian 
> mid 
> > line and Price but here is the code written for Tradestation:
> > 
> > {-- Plot delta of price from Donchian mid line ----------}
> > value2 = LinearRegValue(price-((Highest(H, Length)+Lowest(L, 
> > Length))/2 + xAverage(c,Length))/2,Length,0);
> > 
> > --Here is my question: why are they using LinearReg to smoothen a 
> > curve; as far as i understand if we use linear regression to fit a 
> > curve it will fit it into a straight line; so if i use some linear 
> > regression to smoothen the histogram i will rather get some 
> straight 
> > line parallel to the zero line. Perhaps LinearRegValue function in 
> > tradestation does something totally different than what it is named 
> > after? 
> > 
> > does anyone know what this above line of code exactly does in 
> > tradestation? 
> > 
> > -- Another question: what is the best way to smoothen some curve 
> like 
> > that with minimal lag and minimal zig-zagging.  i am looking into 
> > some adaptive moving averages etc; perhaps even a MACD kind of a 
> > thing on the momentum will do. but any ideas as to the best way to 
> > smoothen a curve? (i know this is a classical question; but 
> probably 
> > there is a good answer somewhere).
> > 
> > Regards
> > Gariki.
> > 
> > PS: Also here is the code for the histogram i am playing with
> > 
> > //CODE START ****************************************
> > /*
> > Plots the delta between Price and Donichan midline. Also in second 
> > plot i am plotting a modified version of this delta because this is 
> > what the tradestation code seems to be doing. but in addition to 
> this 
> > the trade station code is calculating something using a function 
> > LinRegressionValue() that i am not able to replicate. This code is 
> > used in addition with the code to see if the squeeze is in effect 
> > (Bollinger bands inside Keltner channel) to use as a momemtum play.
> > */
> > 
> > MomentumValues = ParamField( "Field" ) - Ref(ParamField
> ( "Field" ), -
> > 12);
> > Plot( MomentumValues, "myMomentum_12_Days", colorRed, styleLine);
> > 
> > pds=20;
> > DonchianUpper =HHV(Ref(H,-1),pds);
> > DonchianLower = LLV(Ref(L,-1),pds);
> > DonchianMiddle = (DonchianUpper+DonchianLower)/2;
> > 
> > deltaDonichanPrice = Close - DonchianMiddle;
> > 
> > Plot(deltaDonichanPrice, "myBBSqueeze",colorBlack, styleHistogram | 
> > styleThick );
> > 
> > value2 = (Close - (( DonchianMiddle + EMA(Close, 20) )/2) );
> > 
> > Plot(value2, "value2",colorRed, styleHistogram | styleThick );
> > 
> > _SECTION_BEGIN("EMA1");
> > P = ParamField("Price field",-1);
> > Periods = Param("Periods", 15, 2, 200, 1, 10 );
> > Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", 
> > colorCycle ), ParamStyle("Style") ); 
> > _SECTION_END();
> > 
> > 
> > //CODE END  ****************************************
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "gunovanengel" <gunovanengel@> 
> > wrote:
> > >
> > > Hi,
> > > Squeeze
> > > http://www.amibroker.com/library/detail.php?id=453
> > > Heikin ashi = ttmTrend
> > > http://www.amibroker.com/members/traders/02-2004.html
> > > 
> > > Regards
> > > Guno
> > > --- In amibroker@xxxxxxxxxxxxxxx, "chetan_gariki" 
> <chetan_gariki@> 
> > > wrote:
> > > >
> > > > Hello Everyone,
> > > > 
> > > > I am new to AB and am just getting used to the program; i am 
> > > interested 
> > > > in Tradethemarket indicators (TTM Squeeze and TTM Trend). I am 
> > > trying 
> > > > to code these indicators but wanted to check if someone already 
> > has 
> > > a 
> > > > good version of these indicators. 
> > > > 
> > > > References:
> > > > http://www.tradethemarkets.com/products/department2.cfm
> > > > 
> > > > They have code available for tradestation here:
> > > > http://www.traderslaboratory.com/forums/46/heikin-ashi-trend-
> > > indicator-
> > > > 951-2.html
> > > > 
> > > > 
> > > > 
> > > > Thank you
> > > > gariki
> > > >
> > >
> >
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Transfer from your equities account.  
Receive up to $1,000 from GFT. Click here to learn more.
http://us.click.yahoo.com/aZttyC/X_xQAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/