PureBytes Links
Trading Reference Links
|
Nothing like coffee and Amibroker first thing in the morning.
Please have someone re-check codes for you or tweak it for you.
MaxVol= 2*(MA(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);
sum1= MA(Sum(Up,21),3) -Sum(Down,21);
Plot (sum1,"Market Sentiment Indicator",4,1);
//end of code
Periods = Param("OBV Periods", 26, 26, 1300, 1 );
Smooth = Param("Smoothing Periods",1,21,3);
Trigger = Param("Trigger Line", 2.5, 2.5, 50, 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 (MA(Value,Smooth),"Smooth",6,1);
Plot (MA(Value,Trigger),"Trigger",8,1);//end of code Tomasz Janeczko <amibroker@xxxxxx> wrote:
Hello,
How to translate MS to AFL:
1. Replace assignments := with = 2. Replace equality checks = with == 3. Replace MOV( array, periods, S ) with MA 4. Replace MOV( array, periods, E ) with EMA 5. Replace If with IIF 6. Replace Input with Param 7. Replace singe quotes in string ' ' with double quotes " "
Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "bruiserbbq" <bruiserbbq@xxxxxxxxxxxx> To: <amibroker@xxxxxxxxxxxxxxx> Sent: Sunday, February 20, 2005 5:58 AM Subject: [amibroker] Indicator help...
> > > 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! >
> > > > > > 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 > > > > > > > >
Check AmiBroker web page at: http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
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
|