|
ap·pren·ticeGuru
 Veteran
 Posts: 123
Joined: 10/22/2010
Location: Columbia, MD
User Profile |
Hello All,
I need assistance in a OL code that would decipher volume to give reading of average globex volume (6p.m. - 9:29a.m. E.S.T.) and same for RTH - 9:30a.m.-4:15p.m. for historical evaluation purposes for 1, 5, 10, etc. days. Thank You.
|
|
Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
What symbol are you referring to?
|
|
ap·pren·ticeGuru
 Veteran
 Posts: 123
Joined: 10/22/2010
Location: Columbia, MD
User Profile |
Hi Jim:
The eminis: ESH16, YMH16, and NQH16. Thanks.
|
|
Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
I'm not exactly sure what you mean by the list of days, but it's likely to require much more complex coding to be able to input #days ... presumably for an intraday current timeframe. So, the code below leaves that up to you ... you decide how many bars must be in the average to cover the calendar time span that you want. This code extracts the bars for APPROX the time windows you specified for the unweighted sum of those three symbols ... the precise windows can be coded but too time consuming for me right now, especially at N/C ;~)
#Indicator
#param "AvgPds", 20, 10, 40
#param "DayNiteBoth", 1, 1, 3
dim Globex, AvGX, Live as single
if bardayofmonth()<>bardayofmonth()[1] then Globex = 0
if DayNiteBoth = 1 or DayNiteBoth = 3 and barhour()>=9 and barhour()<=16 then Live=true
if DayNiteBoth = 2 or DayNiteBoth = 3 and barhour()>=18 or barhour()<=9 then Live=true
if Live then Globex = GetVolume("ESH16")+GetVolume("YMH16")+GetVolume("NQH16")
if bar >= AvgPds then
AvGX = SMA(Globex,AvgPds)
plot("AvGX",AvGX)
end if
return AvGX
... have not tested the code but barring some dumb syntax typo it should work fine.
|