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

Re: composites



PureBytes Links

Trading Reference Links

Jayson

I don't understand the two lines below: ("newhigh,1,0" 
and "newlow,1,0").



AddToComposite(IIf(x==1 AND newhigh,1,0),"~Capital 
Goods","H",flags=1);

AddToComposite(IIf(x==1 AND newlow,1,0),"~Capital Goods","L",flags=1);


Seems they should be "newhigh" and "newlow" without the "1,0"
--- In amibroker@xxxx, "Jayson" <jcasavant@xxxx> wrote:
> 
> Tomasz, all;
> 
> I run a scan nightly to create composites for my sector work. 
each night I
> will have to delete the composites and start over because I get the
> following result.......
> 
> 
> 
> 
> the partial code that creates one of the composites is.....
> 
> Buy=1;
> 
> newhigh=C>Ref(HHV(C,25),-1); //stocks making new high
> 
> newlow=C<Ref(LLV(C,25),-1); //Stocks making new low
> 
> x=SectorID(0);
> 
> AddToComposite(IIf(x==1,C,0),"~Capital Goods" ,"c",flags=1);
> 
> AddToComposite(IIf(x==1,V,0),"~Capital Goods" ,"v",flags=1);
> 
> AddToComposite(IIf(x==1,1,0),"~Capital Goods" ,"O",flags=1);
> 
> AddToComposite(IIf(x==1 AND newhigh,1,0),"~Capital 
Goods","H",flags=1);
> 
> AddToComposite(IIf(x==1 AND newlow,1,0),"~Capital 
Goods","L",flags=1);
> 
> 
> 
> I added the flags=1 and it seemed to work in the previous beta but 
I only
> used the flag a couple of times before the last upgrade. Since the 
upgrade
> it does not seem to solve the problem. Once deleted and recreated 
it works
> fine. Any guidance would be welcome.
> 
> TIA
> 
> Jayson