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.


  Current location        Thread information  
OmniTrader Pro Resource Forum
OmniTrader Pro Technical Support
Market Profile Indicator
Last Activity 4/16/2025 3:28 AM
7 replies, 983 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : Market Profile Indicator
Posted : 7/7/2022 7:39 AM
Post #32030

I am trying to build a Market Profile indicator.
I need to look at volume at a lower timeframe so I can see the lower timeframe price and volume distribution.
If I look at the one hour timeframe I would look at the underlying 5min intervals.
But first I need to be able to address the underlying timeframes correctly.

In the simple example it should look at the 30min timeframe while I am on a 60min. The volume of the last 30min plus the 30min before should add up to the current 60min bar volume.
But it doesn't...

#Indicator
dim a,b,d as single

a=mt(v,"30m",1)
b=mt(v,"30m",1)[1]
d=a+b

plot("a",a,black)
plot("b",b,green)
plot("d",d,blue)

Return 0
Attached file : Market Profile2.png (7KB - 164 downloads)

^ Top
Barry Cohen

Idol
2000100100100
Posts: 2305

Joined: 1/1/1900

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/7/2022 10:33 AM
Post #32031 - In reply to #32030

Try this. Using the MT function, 1 = dynamic, 2 = previous bar, 3 = previous bar with actual data instead of building the data from the current timeframe.

#Indicator
dim a,b,d as single

a=mt(v,"30m",3)
b=mt(v,"30m",3)[1]
d=a+b

plot("a",a,black)
plot("b",b,green)
plot("d",d,blue)

Return 0
^ Top
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/7/2022 12:20 PM
Post #32032 - In reply to #32030

The total vol for the bar should be mt(v,"30m",3)+mt(v,"30m",3)[1] but it still doesn't work.
Also the vol is unchanged for several consecutive bars so something else must be wrong.

Attached file : 30minVol.png (38KB - 169 downloads)

^ Top
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/10/2022 3:42 PM
Post #32035 - In reply to #32030

Sorted the 30min data.
But this picture clearly shows that I only get the total 60min volume even addressing the 30min timeframe.

a=mt(V,"30m",3)
plot("a",a,black)
This should give me the last 30min volume. Instead it gives me the whole 60min.

It is also clear that the green is one 60min timeframe shifted, and also showing the whole 60min volume.
b=mt(V,"30m",3)[1]
Shows the volume one hour ago for the the whole hour.

[Edited by Boris Lund on 7/10/2022 3:46 PM]

Attached file : Lower timeframe not working.png (37KB - 166 downloads)

^ Top
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/14/2022 7:20 AM
Post #32052 - In reply to #32030

Maybe add this to the manual.
Sorted addressing lower timeframes from a higher timeframe perspective.

Attached file : timeframes explained.png (142KB - 190 downloads)

^ Top
Barry Cohen

Idol
2000100100100
Posts: 2305

Joined: 1/1/1900

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/15/2022 10:39 AM
Post #32056 - In reply to #32052

Smart! I didn't think of that!
^ Top
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 7/17/2022 5:40 AM
Post #32057 - In reply to #32030

Unfortunately that was a fluke from the specific interval I was looking at.
On a 15min lower timeframe it is easier to see.

a=mt("V","15M",2)[0].
The offset refers to the current timeframe. The second parameter has no influence here since we are referring to a lower timeframe.

b=mt("V","15M",2)[1]
The offset will point us to the last 60min timeframe and give us the last 15min data. The offset point to the current (60min) timeframe and not the 15min referred lower timeframe.

Then I tried a workaround changing the timeframes, since the 15min[1] is equal to 30min minus 15min like this
mt("V","30M",2)-mt("V","15M",2)
That works. So now I have 15min[0] and 15min[1] the two last 15min component.
So now it should only be a matter of adding timeframes of bigger sizes in steps of 15. Thus we need the 45M.
Adding that, the 3. 15min timeframe (15min[2]) should be the 45M-30M like this
mt("V","45M",2)-mt("V","30M",2)
But that doesn't work. Something messes up due to the 45M offset not being a whole fraction of 60M.

So I am back to not being able to refer to the individual smaller timeframe offsets.


Attached file : timeframes 15min_b.png (179KB - 175 downloads)

^ Top
Steve Johnson

New User

Posts: 3

Joined: 4/29/2020
Location: Olathe, KS

User Profile
 
Subject : RE: Market Profile Indicator
Posted : 9/7/2022 2:32 AM
Post #32088 - In reply to #32030

I was researching the MT indicator and ran across your thread. At first I didn't think the indicator worked for smaller timeframes, but I did find that a function like SUM for 3 five min bars while in 15 min timeframe was indeed the same result as adding each of the 5 min bars within that 15 min bar.

You are correct that the value returned for OLHCV is the last lower timeframe bar within the larger timeframe. Then it hit me to try this:

MT(V[1],"5M",0) to get the previous 5 min bar. Unfortunately, OT didn't like that syntax and wouldn't compile.

But wait! Wrap V[1] inside an indicator and maybe...

ExtractV.txt

#Indicator
#Param "Barsback", 0
Dim mydata As single
mydata = V[Barsback]
Return mydata

Then: MT(ExtractV(2),"5M",0) will give you the first 5 min volume bar from the 15 min bar.

I tried to build an elegant solution where I could pass in the data type (OLHCV), bars to look back, lower timeframe number (e.g. -1) and # of lower timeframe bars covered by the current timeframe, but the ExtractV indicator would not work using variables in the MT formula. It just would not compile unless I inserted a simple number for the Barsback parameter. My only solution idea is a large select case structure for each data type and bar position. If you want to cover looking at say 5 min bars from a 60 min current timeframe, you need 12 select case statements for each data type you want to cover.

Hopefully that gives you enough to continue your original idea.
Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


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