Can we have afl code on daily chart like ORB

#1
Hi Experts

I saw the orb code.
I am wondering if we can have a code similar to this orb on daily or hourly basis.

daily ORB
Objective is locate range bound areas,
Hourly orb
in a daily chart we use 5 min data and get 75 data points.

suppose we take a week,we get 33 hours data.this may be low,let us take a months hourly data-say 132 data points-seems fair enough.
On this hourly chart how to mark range like ORB?

CAN somebody give hints or give code please!
 
#2
Hi Experts

I saw the orb code.
I am wondering if we can have a code similar to this orb on daily or hourly basis.

daily ORB
Objective is locate range bound areas,
Hourly orb
in a daily chart we use 5 min data and get 75 data points.

suppose we take a week,we get 33 hours data.this may be low,let us take a months hourly data-say 132 data points-seems fair enough.
On this hourly chart how to mark range like ORB?

CAN somebody give hints or give code please!
Hint:

Use last Thursday of the Month as a cutoff . . . the same code we use to mark expiry date

Can do that directly on daily charts for expiry to expiry ORB trade on Daily TF :thumb:


:) Happy


EDIT:
Code:
function Lastthursday()
{
  Daysinmonth = IIf(Month()==2,IIf(Year()%4 == 0 AND Year()%100!=0,29,28), 
                IIf(Month()==1 OR Month()==3 OR Month()==5 OR Month()==7 OR Month()==8 OR Month()==10 OR Month()==12,31,30));
  returnvalue = IIf(Daysinmonth-Day()<7 AND DayOfWeek()==4,1,0);
  return returnvalue;
}

Range of the next day of expiry day can be considered as Opening Range for the forward month and an ORB trade can be taken based on that, add some filters etc . . . I don't intend to trade this kind of higher TF system so don't want to code the complete system.

I had used the above code to test some options trading system concepts.
The code needs one more validation, for handling the case where last Thursday is a market holiday.
I did not bother about it as i was testing concepts and not used it for a complete system.

:) Happy
 
Last edited:

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?