How to avoid negative spread when adjust during MT5 export
Posted: Sun May 28, 2023 7:11 pm
Dear Support team,
I have been using your previous suggestion to adjust tick spread with below commands to export data to MT5, as I would like to replicate my ECN account's real spreads.
Bars:
{BarBeginTime:yyyyMMdd},{BarBeginTime:HH\:mm\:ss},{Open},{High},{Low},{Close},{BarTickCount},{BarTickCount},{BarMaxSpread*100000-10:F0}
Ticks:
{Timestamp:yyyyMMdd},{Timestamp:HH\:mm\:ss},{BidPrice+0.00005},{AskPrice-0.00005},{BidPrice+0.00005},{BidVolume:F0}
However, this leads to negative spreads for some ticks, e.g. ask price < bid price. How can I avoid the negative spreads? Is there a place that can set mininum value of spreads to be 0?
Please let me know if my question is unclear, and look forward to hearing from you soon!
Thanks,
Shawn
I have been using your previous suggestion to adjust tick spread with below commands to export data to MT5, as I would like to replicate my ECN account's real spreads.
Bars:
{BarBeginTime:yyyyMMdd},{BarBeginTime:HH\:mm\:ss},{Open},{High},{Low},{Close},{BarTickCount},{BarTickCount},{BarMaxSpread*100000-10:F0}
Ticks:
{Timestamp:yyyyMMdd},{Timestamp:HH\:mm\:ss},{BidPrice+0.00005},{AskPrice-0.00005},{BidPrice+0.00005},{BidVolume:F0}
However, this leads to negative spreads for some ticks, e.g. ask price < bid price. How can I avoid the negative spreads? Is there a place that can set mininum value of spreads to be 0?
Please let me know if my question is unclear, and look forward to hearing from you soon!
Thanks,
Shawn