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

[amibroker] Re: Please Help a Newbie get started with simple code!



PureBytes Links

Trading Reference Links

You can set a parameter something like this:

// the following uses 15 minute increments, the 1500
timeopen = Param("Open time (hhmmss)", 93000, 0, 235959, 
1500);     // start trading at 9:30 AM 
timeclose = Param("Close time (hhmmss)", 100000, 0, 235959, 
1500);  // end trading at 10:00 AM 

Then use timenum() to get the bar time.
Since this is an array you have to use lastValue to get the current 
bar time. So .. 

barTime = LastValue(timenum());
declare the vars you want to use in the IF statement below our you 
will get an error when you try to plot or use the data later. Just 
set them to null values, 0 or false or "".

if( barTime >= timeopen AND  barTime <= timeclose)
{
  place your code for high or low and breakouts here
}

Or you can use IIF(...); something like this
tradeFilter = barTime >= timeopen AND  barTime <= timeclose;
myHigh = IIF(tradeFilter AND your high or breakout condition, value 
or true, 0 or false);

You will need to use Filter = whatever condition you want Explore to 
act on and then AddColumn to show the data in Explore.

Hope tht helps,
Barry

--- In amibroker@xxxxxxxxxxxxxxx, "jorgen_wallgren" 
<jorgen.wallgren@xxx> wrote:
>
> Hi All,
> 
> I have just purchased AmiBroker and I love it!!! Now I want to get 
> started with a simple Exploration, but can't get it to work and 
> searching desperately for the way to solve my simple task. I was 
> hoping someone here could help me and tell me how I solve the 
> following task with programming:
> 
> Basically I want to make an Exploration, that searcher for 
breakouts 
> with some specific criteria's. I got the criteria's down, except 
one 
> portion. 
> 
> I can't understand how I should define a time frame during the day- 
> for example- 9:30 am to 10:00 am (30 first minute of Nasdaq 
> opening). Then I want my program to get the High and the Low Close 
> values during this specified period (I should also be able to 
change 
> the period- let's say 10:00 AM to 11:00 AM). Basically if I run the 
> program at 10:15 AM, by knowing the High and Low during the first 
30 
> minutes, I can then check if there has been a break-out during the 
> last 15 minutes.
> 
> I would highly appreciate if someone could advice me or if you 
> have/know some sample code- doing exact this.
> 
> Looking forward to your reply!
> 
> Thanks,
> 
> Jorgen
>



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

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> 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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/