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

[amibroker] ORB Code Help



PureBytes Links

Trading Reference Links


hello

I had attempted to code the Opening Range Breakout (ORB) concept for 
intraday trading.Which demands specific conditions as follows,
1) The opening 5 min range of stock should be higher than the 
average of past 10 days opening 5 minutes range.
2) To enter a trade, the strech(value of open minus low or high , 
whichever occured 1st) value is added to high of 1st minutes high or 
substracted from 1st minutes low, depending upon whether stocked 
opened and moved  up or down w r to previous close.

I have tried to put the best I know , but when I add filter R>AvgR , 
the exploration runs without ant results , else it shows bizzre 
values.
Can any one please hepl me put on right track.This exploration is to 
run on the trading day after 5 minutes of opening.
//Code Start
// Avg 5Minutes range
Var1=TimeFrameGetPrice("H",in5Minute,0,expandFirst);//highest value 
in 1st 5 minutes of the day
Var2=TimeFrameGetPrice("L",in5Minute,0,expandFirst);//lowest value 
in 1st 5 minutes of the day
R=Var1-Var2;//1st 5 minute range
TimeFrameSet(inDaily);
AvgR=MA(R,-10);//Avg 5 minutes range in last 10 days
TimeFrameRestore();

// Calculating strech- it calculates the first most occured high or 
low from open
TimeFrameSet(in1Minute);
IIf(BarsSince(H)<BarsSince(L),strech=abs(O-H),strech=abs(O-L));
TimeFrameRestore();

TimeFrameSet(in1Minute);
BuyNumber=H+strech;//1st min high + strech
SellNumber=L-strech;//1st min Low - strech
TimeFrameRestore();

Filter=GroupID()==1 AND R>AvgR ;
AddColumn(BuyNumber,"Buy Value",1.2);
AddColumn(SellNumber,"Sell Value",1.2);
AddColumn(R,"1st 5 Min Range",1.2);
AddColumn(AvgR,"Avg 5Min range",1.2);
AddColumn(ATR(5),"Daily Range",1.2);
AddColumn(strech,"strech",1.2);

//Code End

Regards





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/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/