Mike --
This is just a guess. But, each bank probably has a different total
number of bars. So the Cum() is going to be 'acCumulated' over a
different period. Rather than using Cum() why not use the sum( ARRAY,
periods ). And make sure the 'periods' does not exceed the minimum
number of bars for all the stocks used in the group that you are analyzing.
-- Keith
On 3/19/2010 16:32, Mike wrote:
I'm new to this add to composite function and I am using this code to
plot an AD line.
...............................................
int_string = "Banking"; //MarketID(1)
Difference = ( Foreign("~adv_" +int_string, "C") - Foreign("~dec_"
+int_string, "C") )/ ( Foreign("~unc_" +int_string, "C")+ 1 );
DiffSqrt = IIf( Difference > 0, sqrt( Difference ), - sqrt( -
Difference ) );
BankADLine = Cum( DiffSqrt );
_TRACE("BankADLine "+ BankADLine );
...............................................
I scaned a watchlist of Banking stocks to get the
~adv_Banking,~dec_Banking, and ~unc_Banking composites which are in
group 253.
Whenever I switch chart tabs at the top of the chart display and the
ticker changes I get a different trace value for the BankADLine.
How are the composite symbols changing their scanned values. I've even
tried the setforeign("sym"); and RestorePriceArrays() ; to lock in the
symbol I think the code is working with but they are completely ignored.
I'm trying to get the AD line values for multiple watchlists/sectors
in one indicator. So I want to repeat "this" code multiple times.
Please help, my head is starting to hurt...this desk is really hard!
Thank you for any assistance!
mike