Page 1 of 1

Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Fri Jan 06, 2023 10:57 pm
by machtucker
Hello,

After some research I’ve found that the spread values exported by BarMaxSpreadInt are quite conservative as it’s the maximum spread that occurred during the bar. Data from MetaQuotes and the broker I use both take the minimum spread in the bar. Is there a way of outputting this token and maybe a mean or mea + nsigma? If not is it something that can be added in the future?

Thanks

Re: Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Sat Jan 07, 2023 1:43 am
by tickstory
Hi Machtucker,

When you say Metaquotes take the minimum spread, what feature/parameter are you referring to? Is there any documentation you can point us to that explains their calculation?

Thanks.

Re: Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Sun Jan 08, 2023 11:44 am
by machtucker
Hi,

Thanks for the reply.

I'm referring to the last value in the MT5 bar csv file which you have told me before is based on the BarMaxSpreadInt token.

I asked on the MQL5 forum and with Darwinex broker about how they are calculating the spread for use with the 1minute OHLC data.

This was the response on the MQL5 forum:
Image

This was the response from Darwinex:
"The data that MT5 provides previous to Darwinex feed is filled directly from MetaQuotes, which is MetaTrader company provider, but I don't know which source they use. The spread column, if I'm not wrong, refers to the number of ticks that are accumulated as spread for every bar. The value is the minimum spread for every bar in the timeframe selected. "

Although there is no official documentation from MetaQuotes both sources believe they use minimum spread within each bar. The analysis performed by a user on the MQL5 forum seems to indicate this too.

Many thanks,

Ed

Re: Spread output for 1 minute OHLC bar data (Minimum Bar Spread)

Posted: Sun Jan 08, 2023 1:00 pm
by tickstory
Hi Ed,

Thanks for the info. If there's a general consensus in the MQL community that the calculation is the minimum spread, then that's a good reason to put in on our TODO list ;) Just to re-iterate, the feature would be to create new tokens called "MinBarSpread" and "MinBarSpreadInt" which would output the minimum spread value (as decimal and integer, respectively) that occurred in the course of the selected bar time-frame.

At this stage, we'll look towards scheduling it on our next release. We'll update this thread when we have further information.

Thanks.

(P.S. We'll move this thread to the "New features" section shortly)

Re: Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Sun Jan 08, 2023 4:46 pm
by machtucker
Good evening,

Yes you have understood and that is what I was expecting.

Another option that would be useful would be to use the mean, which is probably a better estimate than using the minimum.

Therefore I would request the addition of:

MinBarSpread
MeanBarSpread

and

MinBarSpreadInt
MeanBarSpreadInt

Many thanks for considering,

Ed

Re: Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Sun Jan 08, 2023 11:00 pm
by tickstory
Hi Ed,

Thanks for the further clarification. The Mean calculation will probably take a bit more time to implement and test so unlikely we can make that for the next version. We'll add it to our backlog for further prioritization though.

Looking forward, we are working towards providing an API so users can do their own specific customizations as they require.

Thanks.

Re: Spread output for 1 minute OHLC bar data (Minimum bar spread)

Posted: Mon Jan 16, 2023 10:25 pm
by tickstory
Hi Ed,

v1.9.7.6 has just been released which now implements the "MinBarSpread" and "MinBarSpreadInt" tokens which give the minimum spread of the bar.

Hope this helps.