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

Re: [amibroker] What is the most efficent way to get a high or low between 2 bars?


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] What is the most efficent way to get a high or low between 2 bars?
  • From: "Ara Kaloustian" <ara1@xxxxxxxxxx>
  • Date: Thu, 20 Apr 2006 16:52:06 -0700

PureBytes Links

Trading Reference Links

You might first determine when a new bar is formed, then do the computations
only when a new bar is created.

//Detect New Bar
//Variables: NewBar
//
//Using LastValue - Try to avoid
//
//Create function
//

if (IsNull(StaticVarGet("Lastbar")))
{
StaticVarSet("Lastbar",0);
}

//Detect New of bar
//Use to start routines at start of new bar
NewBar = False;
if (StaticVarGet("Lastbar")!=LastValue(BarIndex()))
{
NewBar = True;
StaticVarSet("Lastbar",LastValue(BarIndex()));
}


----- Original Message ----- 
From: "idaytrader" <idaytrader@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, April 20, 2006 4:06 PM
Subject: [amibroker] What is the most efficent way to get a high or low
between 2 bars?


> Hi all,
>
> What is the most efficent way to get a high or low of an array between
> 2 bars?
>
> For example I would like the high of and indicator during the first
> hour of trading (intraday).
>
> I could use a for loop between the two bars but that doesn't seem very
> efficent given the number of times it will execute and return the same
> value.  What would you do?
>
> Just trying to build the best code I can.  Thanks.
>
> Jerry L.
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/