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

RE: [amibroker] Twiggs Money Flow formula



PureBytes Links

Trading Reference Links




<SPAN 
class=596555204-06032003>Anthony,
I also 
do not understand the logic behind line 6 however, I think the reason your code 
is failing is due to  your use of the equal sign. When you set a variable you 
use,  =  as in    x=c+1;
<SPAN 
class=596555204-06032003>However when you are trying to use mathematical equal 
within the code you must use == as in c==42
 <SPAN 
class=596555204-06032003>

  
  
    No
    <FONT color=#0000ff face=Arial 
      size=2>Symbol
    <FONT color=#0000ff face=Arial 
  size=2>Meaning
  
    1
    <FONT color=#0000ff face=Arial 
      size=2>^
    Exponentiation
  
    2
    <FONT color=#0000ff face=Arial 
      size=2>-
    Negation - Unary 
  minus
  
    3
    <FONT color=#0000ff face=Arial 
      size=2>*
    Multiplication 
  
    4
    <FONT color=#0000ff face=Arial 
      size=2>/
    Division 
  
    5
    <FONT color=#0000ff face=Arial 
      size=2>+
    Addition 
  
    6
    <FONT color=#0000ff face=Arial 
      size=2>-
    Subtraction
  
    7
    <FONT color=#0000ff face=Arial 
      size=2><
    Less than 
  
    8
    <FONT color=#0000ff face=Arial 
      size=2>>
    Greater than
  
    9
    <FONT 
      face=Arial><= 
    Less than or equal 
  to
  
    10
    <FONT color=#0000ff face=Arial 
      size=2>>=
    Greater than or equal 
    to
  
    11
    <FONT color=#0000ff face=Arial 
      size=2>==
    Equal to
  
    12
    <FONT color=#0000ff face=Arial 
      size=2>!=
    Not equal to
  
    13
    <FONT color=#0000ff face=Arial 
      size=2>&
    Bit-wise "And" (AFL 
    2.1+)
  
    14
    <FONT color=#0000ff face=Arial 
      size=2>|
    Bit-wise "Or" (AFL 
    2.1+)
  
    15
    <FONT color=#0000ff face=Arial 
      size=2>NOT
    Logical "Not" 
  
    16
    <FONT color=#0000ff face=Arial 
      size=2>AND
    Logical "And" 
  
    17
    <FONT color=#0000ff face=Arial 
      size=2>OR
    Logical "Or"
  
    18
    <FONT color=#0000ff face=Arial 
      size=2>=
    Variable assignment 
      <FONT 
      >operator
 
 
<SPAN 
class=596555204-06032003>try....
<SPAN 
class=596555204-06032003> 
<FONT 
color=#282828 size=2> 
periods=Param(<FONT 
size=2>"TMF periods",21<FONT 
size=2>,1,<FONT 
size=2>100,1<FONT 
color=#282828 size=2>);
TRH=Max(<FONT 
size=2>Ref(C<FONT 
size=2>,-1),<FONT 
size=2>H<FONT 
color=#0000ff>);
TRL=Min(<FONT 
size=2>Ref(C<FONT 
size=2>,-1),<FONT 
size=2>L<FONT 
color=#0000ff>);
TR=TRH-TRL;
ADV=((C<FONT 
size=2>-TRL)-(TRH-C<FONT 
size=2>))/(IIf(TR==<FONT 
size=2>0,999999<FONT 
size=2>,TR))*V<FONT 
color=#0000ff>;
WV=V+(<FONT 
size=2>Ref(Volume<FONT 
size=2>,-1)*<FONT 
size=2>0<FONT 
color=#0000ff>);
TMF=IIf(WV==<FONT 
size=2>0,0<FONT 
size=2>,Wilders<FONT 
size=2>(ADV,periods)/Wilders<FONT color=#282828 
size=2>(WV,periods)); 
 
Plot(tmf,<FONT color=#ff00ff 
size=2>"",<FONT color=#000000 
size=2>colorRed,<FONT color=#ff00ff 
size=2>1);
 
 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: Anthony 
[mailto:axon50@xxxxxxxxxxx]Sent: Wednesday, March 05, 2003 8:32 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Twiggs 
Money Flow formulaHi all I have seen people using 
this and became curious enough to check it out. It is based on the theme of 
the Chaiken Money Flow Index but is designed to better handle price gaps and 
volume spikes. Colin Twiggs is behind it. He has given a Metastock 
formula for it: periods:=Input("TMF 
periods",1,100,21);TRH:=Max(Ref(C,-1),H);TRL:=Min(Ref(C,-1),L);TR:=TRH-TRL;ADV:=((C-TRL)-(TRH-C))/If(TR=0,999999,TR)*V;WV:=V+(Ref(V,-1)*0);If(WV=0,0,Wilders(ADV,periods)/Wilders(WV,periods)) 
Now even though I cannot work out what the sixth line is supposed to 
represent you would think that this was easy enough for me to translate 
but whatever I have done is wrong: periods=Param("TMF 
periods",21,1,100,1);TRH=Max(Ref(C,-1),H);TRL=Min(Ref(C,-1),L);TR=TRH-TRL;ADV=((C-TRL)-(TRH-C))/(IIf(TR=0,999999,TR))*V;WV=V+(Ref(Volume,-1)*0);TMF=IIf(WV=0,0,Wilders(ADV,periods)/Wilders(WV,periods)); 
Any thoughts appreciatedRegardsAnthonySend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT  









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.