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

Re: [amibroker] Re: error #5 Argument #1 has incorrect type ..anyway around this?


  • Date: Thu, 28 Jan 2010 16:31:26 -0600
  • From: Alan Northam <alan@xxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: error #5 Argument #1 has incorrect type ..anyway around this?

PureBytes Links

Trading Reference Links

Maybe something like this will spark the thought process. Just an idea.

//Variables
PERIOD=Param("Period", 288, 1, 1000, 1); //Set Look-back Period
HHB=HHVBars(H,PERIOD); //highest high over last 100 days
LLB=LLVBars(L,PERIOD); //lowest low over last 100 days
TH=High; //today's high

//Equation for Stochastic
eq1 = TH - LLB;
eq2 = HHB - LLB;
PK = (eq1/eq2)*100; //%K

//Plot
Plot(PK,"", colorBlack, 1);


jilm_jones wrote:
>
> I am trying to make the stochastic periods adapt to volitility somehow.
> i can do this using lastvalue but then i cant backtest it.
>
> i want to make the stochastic periods =
> (hhvbars(h,288)-llvbars(L,288))
>
> --- In amibroker@xxxxxxxxxxxxxxx <mailto:amibroker%40yahoogroups.com>, 
> Alan Northam <alan@xxx> wrote:
> >
> > Instead of giving the code to debug perhaps if you describe the 
> function
> > you are trying to perform someone can help you with another way to 
> code it.
> >
> > j0etr4der wrote:
> > >
> > > I cannot help you with a solution, but can tell you there are only a
> > > limited number of functions that can accept an array as an argument.
> > > You might be able to do this in loop.
> > >
> > > Good luck.
> > >
> > > >From the User's Guide somewhere:
> > >
> > > The following functions support variable periods (where periods
> > > parameter can be array and change from bar to bar):
> > >
> > > * AMA
> > > * AMA2
> > > * MA
> > > * DEMA
> > > * TEMA
> > > * HHV
> > > * HHVBars
> > > * LLV
> > > * LLVBars
> > > * LinRegSlope
> > > * LinearReg
> > > * LinRegIntercept
> > > * Ref
> > > * StdErr
> > > * Sum
> > > * TSF
> > > * WMA
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx 
> <mailto:amibroker%40yahoogroups.com> 
> <mailto:amibroker%40yahoogroups.com>,
> > > "jilm_jones" <Jilm_Jones@> wrote:
> > > >
> > > >
> > > >
> > > > say i want to write this:
> > > >
> > > > t=hhvbars(h,100);
> > > > x=stochk(t);
> > > >
> > > > plot(x....
> > > >
> > > > i cant use lastvalue(t);
> > > >
> > >
> > >
> >
>
> 



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/