PureBytes Links
Trading Reference Links
|
If, as the forum says...
Green Histogram & Blue line above 0 is buy
Red Histogram & Blue line under 0 is sell
Then the code would be
Buy = Ergodic > SigLin AND Hist >= 0;
Sell = SigLin > Ergodic AND Hist < 0;
Filter = Buy OR Sell;
AddColumn(Filter,"Signal",1.0);
(you may want to separate the Addcolumn stuff)
Rick
--- Larry <rayman@xxxxxxxxxxxxxx> wrote:
> Hi there,
>
> I came across the above indicator at
> www.amibrokerfan.com (forum).
>
> I found it useful as an indicator but I was
> wondering if it can be turned into a scanner also
> with the inclusion of buy and sell signals. I am not
> sure but I think a buy signal is when
> the signal line crosses above the Ergodic
> Oscillator. Could someone please help with the
> necessary codes.
>
> I reproduce the original code below for your easy
> reference.
>
> Thank you.
> Larry
>
> // Blau: TSI & Ergodic Oscillator
>
> Len_r = Param( "TSI period 'r':", 32 , 1 , 100 );
> Len_s = Param( "TSI period 's':", 5 , 1 , 100 );
> Len_5 = 5 ;
>
> Mtm = C - Ref ( C, -1 );
> AbsMtm = abs ( Mtm );
> //===============================
> Num_T = EMA ( EMA ( Mtm, Len_r ), Len_s );
> Den_T = EMA ( EMA ( AbsMtm, Len_r ), Len_s );
>
> TSI = 100 * Nz ( Num_T / Den_T );
> //===============================
> Num_E = EMA ( EMA ( Mtm, Len_r ), Len_5 );
> Den_E = EMA ( EMA ( AbsMtm, Len_r ), Len_5 );
>
> Ergodic = 100 * Nz ( Num_E / Den_E );
> SigLin = EMA ( Ergodic, Len_5 );
> //===============================
> GraphXSpace = 2 ;
> //Plot( TSI, "TSI", colorGreen, styleLine );
> ErgCol = colorBlue ;
> Plot( Ergodic, "Ergodic Osc.", ErgCol, styleLine
> );
> Plot( SigLin, "", colorDarkYellow, styleLine );
> //===============================
> Hist = Ergodic - SigLin;
> HistCol = IIf ( Hist>= 0, colorGreen, colorRed );
> Plot(Hist, "Histogram", HistCol, styleHistogram |
> styleThick |
> styleNoLabel );
> //===============================
> Title = EncodeColor( colorDarkBlue ) + FullName() +
> " [" + Name() + "]
> " +
> EncodeColor( colorDarkGrey ) + WriteVal( DateTime(),
> formatDateTime ) +
> "\n" +
> EncodeColor( colorBrown ) + "Blau: The Ergodic
> Oscillator, EO(" +
> EncodeColor( ErgCol ) + "r" + EncodeColor(
> colorBrown ) + ",5,5 ) " +
> EncodeColor( ErgCol ) + "r_Pds: " + Len_r +
> EncodeColor( colorGrey40 ) + " (Adjustable).";
> //===============================
>
>
Rick Osborn & Associates
885 Sorrento Ave.
Oshawa, Ontario L1J 6V6
(905) 728-8543 fax 728-0815
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/
|