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

[amibroker] Re: Indicator help...



PureBytes Links

Trading Reference Links


Hi Brusier,

here is the code... should you separate the second indicator please
delete 

|styleLeftAxisScale

from all plot instructions.



//Market Sentiment Indicator
MaxVol=2*(EMA(Volume,50));
Adjustment=Volume-(Volume-MaxVol);
Value=IIf(Volume>MaxVol,Adjustment,IIf(Volume<MaxVol,Volume,Volume));
Up=IIf(Close>Ref(Close,-1),(Close-Ref(Close,-1))*Value,(Close-Ref(Close,-1))*Value);
Down=IIf(Close<Ref(Close,-1),(Ref(Close,-1)-Close)*Value,(Ref(Close,-1)-Close)*Value);

Plot(EMA(Sum(Up,21)-Sum(Down,21),3),"Market
Sentiment",colorBlue,styleLine);
Plot(0,"",1,1);


//OBV Index Indicator.
Periods=Param("OBV Periods",21,1,55,1);
Smooth=Param("Smoothing Periods",3,1,21,1);
Trigger=Param("Trigger Line",13,1,35,1);
Up=(Sum(IIf(OBV()>Ref(OBV(),-1),0,OBV()-Ref(OBV(),-1)),Periods));
Down=(Sum(IIf(OBV()<Ref(OBV(),-1),0,Ref(OBV(),-1)-OBV()),Periods));
Value=(100-(100/(1+((Down+0.000001)/Up))));
Plot(EMA(Value,Smooth),"OBV
Index",colorGreen,styleLine|styleLeftAxisScale);
Plot(EMA(Value,Trigger),"trigger",colorRed,styleLine|styleLeftAxisScale);
Plot(20,"",1,1|styleLeftAxisScale);
Plot(80,"",1,1|styleLeftAxisScale);



Hans

--- In amibroker@xxxxxxxxxxxxxxx, "bruiserbbq" <bruiserbbq@xxxx> wrote:
> 
> The code below is Metastock...can someone convert them to AB for me
> please? I'm hopeless at code.....in fact my wife thinks its not only
> code that I'm hopeless at.....but MOST THINGS.
> 
> Market Sentiment Indicator.
> 
> MaxVol:=2*(Mov(Volume,50,E));
> Adjustment:=VOLUME-(VOLUME-MaxVol);
> Value:=If(VOLUME>MaxVol,Adjustment,If(VOLUME<MaxVol,VOLUME,VOLUME));
> Up:=IF(CLOSE>Ref(CLOSE,-1),(CLOSE-Ref(CLOSE,-1))*V
> alue,(CLOSE-Ref(CLOSE,-1))*Value);
> Down:=If(CLOSE<Ref(CLOSE,-1),(Ref(CLOSE,-1)-CLOSE)
> *Value,(Ref(CLOSE,-1)-CLOSE)*Value);
> Mov(Sum(Up,21)-Sum(Down,21),3,E);0;
> 
> 
> OBV Index Indicator.
> 
> Periods:=Input(`OBV Periods',1.55.21);
> Smooth:=Input(`Smoothing Periods',1,21,3);
> Trigger:=Input(`Trigger Line',1,35,13);
> Up:=(Sum(If(OBV()>Ref(OBV(),-1),0,OBV()-Ref(OBV(),-1)),Periods));
> Down:=(Sum(If(OBV()<Ref(OBV(),-1),0,Ref(OBV(),-1)-OBV()),Periods));
> Value:=(100-(100/(1+((Down+0.000001)/Up))));
> Mov(Value,Smooth,E);
> Mov(Value,Trigger,E);20;80;
> 
> Thanks in advance
> Dumb (and hopless) Brusier!





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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

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