|
Description |
This formula accesses the volume of a daily bar. Use the index parameter to specify the bar, or daily session, you want to access. 0 is the current session, 1 is yesterday's session, etc. |
|
|
Formula |
GetVolume(instrument, index)=begin targetBar = index - 1 retval = vchart(instrument.volume[targetBar]) end |
|
|
Parameters |
instrument The instrument argument specifies which instrument to evaluate.
index The index parameter enables you to specify the bar for which you want to retrieve volume. Use 0 to specify the current bar, 1 to specify the first bar back, 2 to specify the second bar back, etc. |
|
|
Return Value |
The volume of the specified daily bar. |
|
|
Examples |
MoneyFlow_1(instrument, Length)=begin pmf = 0 nmf = 0 avp = 0 volVal = 0 MoneyRatio = 0 MoneyFlow = 0
for i = 0 to (Length - 1) begin avp = AvgPrice(instrument, i) pavp = AvgPrice(instrument, (i + 1)) volVal = avp + GetVolume(instrument, i) if avp > pavp then pmf = pmf + volVal + avp else nmf = nmf + volVal end if nmf != 0 then MoneyRatio = pmf / nmf else MoneyRatio = 0 if (1 + MoneyRatio) != 0 then MoneyFlow = 100 - (100 / (1 + MoneyRatio)) else MoneyFlow = 0 MoneyFlow end |
|
|
Comments |
NA |
©2008 Aspen Research Group, Ltd. All rights reserved. Terms of Use.