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

[amibroker] Re: The "Stochastic Trend Filter"



PureBytes Links

Trading Reference Links

Hi,

Commenting only on the code structure; You can improve things by not 
repeating the same calcuations unnecessarily.

Mike

// Stochastic Trend Filter
Periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 50, 1, 200, 1 );
EMAKsmooth = EMA( C, Ksmooth );
PriorEMAKsmooth = Ref( EMAKsmooth, -1 );
StochKKsmooth = StochK( Periods, Ksmooth );

Plot( IIf( EMAKsmooth > PriorEMAKsmooth, StochKKsmooth, 0 ), "", 27 );
Plot( IIf( EMAKsmooth < PriorEMAKsmooth, StochKKsmooth, 0 ), "", 4 );

--- In amibroker@xxxxxxxxxxxxxxx, "Gerard Carey" <gcfinance@xxx> 
wrote:
>
> The Stochastic Trend Filter
> A trader mate of mine asked me to create a stochastic filter for 
him.
> He wanted one that would use stochastics to determine the character 
> of the predominant trend.
> He wanted to do some backtesting, taking only (short-term) long 
> trades when a stochastic filter showed the predominant trend was 
> positive & only (short-term) shorts when it was negative.
> He uses stochos as an important part of his trading system. 
> I'm sure he knows them upside down & inside out, so he obviously 
just 
> wanted somebody to take a fresh look, without any of his bias.
> After checking it out he reckons it's cool and works better than 
what 
> he used previously, tho he reckons there are nuances he wants to 
> investigate further. So for him it's early days.
> Anyway here 'tis for your evaluation and edification.
> I trust it may be of value.
> 
> Regards, good trading and have a good weekend,
> Gerard
> 
> // Stochastic Trend Filter
> periods = Param( "Periods", 15, 1, 200, 1 );
> Ksmooth = Param( "%K avg", 50, 1, 200, 1 );
> 
> Plot( IIf(EMA(C,Ksmooth)>Ref(EMA(C,Ksmooth),-1),StochK( periods , 
> Ksmooth),0),"",27) ;
> Plot( IIf(EMA(C,Ksmooth)<Ref(EMA(C,Ksmooth),-1),StochK( periods , 
> Ksmooth),0),"",4) ;
> 
> /*
> INTERPRETATION
> So the deal is;
> NB. The Filter is designed for those taking relatively short term 
> trades, say up to 15 bars max.
> When green line is on top the Predominant trend is positive, take 
> only long signals, red on top then only shorts are allowed.
> That's it. 
> Its rather simple construction belies the effort spent on its 
> development.
> In short what I needed to do was to identify, in a general way, the 
> trends a data series may contain, and then determin the specific 
> trend ( the predominant one) that should be applied to a specific 
> trading time frame. 
> */
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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/