OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Globex volume ...
Posted : 1/13/2016 11:58 AM
Post #24959 - In reply to #24956

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.
Deleting message 24959 : RE: Globex volume ...


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.