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

[amibroker] Re: initial or initialize variable



PureBytes Links

Trading Reference Links


Hello,

First of all, thank you for the effort, but it does not seem to be the
solution.

I do not agree that I'm trading into the future, because I start with
barsince=0, since I have no buy/sell signal, so that CCI period is 10.

Until I get the first buy/sell counting of bars does not happen. e easy.

Hope to get some help from one of them.

Hans


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> You have a absic problem with the system logic in that you cannot
> define a signal before it has occured. You are in effect trading into
> the future. But with a small change it may (or not) work. Cannot
> promise that :(
> 
> 
> p4=10;
> 
> buysig = Cross(Cci(p4),-100);
> Sellsig=Cross(100,Cci(p4));
> 
> bs=BarsSince(Buysig OR Sellsig);
> pp=Max(bs,p4);
> CC=CCI(pp); //variable for period not allowed
> 
> Buy=Cover=Cross(Cc,-100);
> Sell=Short=Cross(100,Cc);
> 
> I just quickly checked the syntax in AB and I don't think CCI allows
> the periods to be variable. it must be a set value.
> 
> Therefor you would probably need to work this into a loop to get to
> owrk, sorry I don't have time at present to do any more on this.
> 
> On Sun, 20 Feb 2005 10:18:54 -0000, Hans <hansib@xxxx> wrote:
> > 
> > 
> > Please help,
> > 
> > Thanks
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Hans" <hansib@xxxx> wrote:
> > >
> > > Hello,
> > >
> > > I need some help.
> > >
> > > My goal is to have a CCI with variable period so that bars since buy
> > > or sell that exceeds 10 are the new CCI period.
> > >
> > > I have coded this:
> > >
> > > p4=10;
> > >
> > > bs=BarsSince(Buy OR Sell);
> > > pp=Max(bs,p4);
> > > CC=CCI(pp);
> > >
> > > Buy=Cover=Cross(Cc,-100);
> > > Sell=Short=Cross(100,Cc);
> > >
> > > **********
> > > problems are initialization of arrays.
> > > how can i consider buy/sell before calculation, and at the same time
> > > to make calculations i need buy/sell.
> > >
> > > Thanks for any help.
> > >
> > > Hans
> > 
> > 
> > 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
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/