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

RE: [amibroker] Conversion to Amibroker



PureBytes Links

Trading Reference Links

Here's one way to do this:
************************************
// function version of Chande Momentum Oscillator
 
function funcCMO(periods) {
local cmo_1;
local cmo_2;
local cmo;

cmo_1=Sum( IIf( C > Ref( C, -1 ) , ( C - Ref( C ,-1 ) ) ,0 ) , periods ) ;
cmo_2=Sum( IIf( C < Ref( C ,-1 ) , ( Ref( C ,-1 ) - C ) ,0 ) , periods );
cmo=100 * (( cmo_1 -cmo_2) /( cmo_1+cmo_2));
return cmo;
}

cmo_a = funcCMO(3);
cmo_b = funcCMO(5);
cmo_c = funcCMO(8);

cmo_AV = (cmo_a + cmo_b + cmo_c)/3;

Plot(funcCMO(21),"CMO",32,4);
Plot(Cmo_AV,"CMO avg",42,2); // 2 = histogram
PlotGrid(0,55); //for black background
PlotGrid(50,55);
PlotGrid(-50,55);

hope this helps  :-)

Wayne S
 

cdickerm wrote:

> Is there a straightforward conversion of this to Amibroker:  (CMO(C,3)
> +CMO(C,5)+CMO(C,8))/3  If so, would someone please help. 
>
> Thanks a lot,
>
> Carey
>
>
>
>
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/) 
> <http://groups.yahoo.com/group/amiquote/messages/%29>
> --------------------------------------------
> Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/amibroker/
>        
>     * To unsubscribe from this group, send an email to:
>       amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

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

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/