Can I find out the biggest spread at the past in MT4?

To add comments, please log in or register
Sky L
1661
Sky L  

Dear experienced traders,

Do you know any method to find out the biggest spread at the past in MT4?

Maybe in the historical data or something.

Thank you in advance and best regards,

Sky

Pavel Shutovskiy
49657
Pavel Shutovskiy  
Hello,
in the historical data of MT4 there is only the bid price and in practice, there is no way to get such data, this can be implemented in MT5 there is a bid and ask on the tick data
Sky L
1661
Sky L  
Pavel Shutovskiy:
Hello,
in the historical data of MT4 there is only the bid price and in practice, there is no way to get such data, this can be implemented in MT5 there is a bid and ask on the tick data

Thank you, Pavel.

Do you mean these stuffs? 

How could I calculate the biggest spread at the past?

Thank you in advance and best regards,

Sky


Pavel Shutovskiy
49657
Pavel Shutovskiy  

read the article

https://en.wikipedia.org/wiki/Bid%E2%80%93ask_spread

this will help answer your questions

Sky L
1661
Sky L  
Pavel Shutovskiy:

read the article

https://en.wikipedia.org/wiki/Bid%E2%80%93ask_spread

this will help answer your questions

Sorry for the last basic question, and thank you so much for your information sharing, Pavel. 

Do you know any method to find out the biggest spread when the spread is floating?

Best regards,

Sky

Marco vd Heijden
Moderator
13040
Marco vd Heijden  

You would have to monitor the spreads over time and record the highest and lowest values of each instrument.

It's not hard to do this.

Sky L
1661
Sky L  
Marco vd Heijden:

You would have to monitor the spreads over time and record the highest and lowest values of each instrument.

It's not hard to do this.

Thank you, Marco.

So, it is not possible to check the biggest spread at the past due to specifications, right?

I just need the biggest spread at the past to decide my minimum deposit for one stratagy.

Best wishes,

Sky

Pavel Shutovskiy
49657
Pavel Shutovskiy  
Sky L:

Thank you, Marco.

So, it is not possible to check the biggest spread at the past due to specifications, right?

I just need the biggest spread at the past to decide my minimum deposit for one stratagy.

Best wishes,

Sky

you can check it only in online mode can use this indicator:

https://www.mql5.com/en/code/9324

Monitoring-Spread
Monitoring-Spread
  • www.mql5.com
Indicator shows a histogram (the idea is not mine) with minimal (), average () and maximal () spread values on the corresponding bars. Such monitoring is very useful for broker's spread compare and for spread dynamics analysis. Image: Fig 1. Indicator's work for real and synthetic currency pairs. Broker X. The information collected doesn't...
Marco vd Heijden
Moderator
13040
Marco vd Heijden  
Sky L:

Thank you, Marco.

So, it is not possible to check the biggest spread at the past due to specifications, right?

I just need the biggest spread at the past to decide my minimum deposit for one stratagy.

Best wishes,

Sky

The data is not part of the history database so you have to monitor the spread continuously and save the highest and lowest values.

So you can code a EA that will simply write the value to a file whenever a new high or a new low is made and you can also add a timestamp to this so that you get an idea of the times most of these changes happen.

Also when you have collected all data for all instruments you can also sort and plot these against each other to get a better picture of the costs of doing business for each of your trading decisions. 

 

Icham Aidibe
11830
Icham Aidibe  

https://docs.mql4.com/constants/structures/mqlrates

Was doubting about mt4, but here it is. It's possible to retrieve the higher spread on a pre-defined interval by using mqlrates :

// mqlrates
struct MqlRates
  {
   datetime time;         // Period start time
   double   open;         // Open price
   double   high;         // The highest price of the period
   double   low;          // The lowest price of the period
   double   close;        // Close price
   long     tick_volume;  // Tick volume
   int      spread;       // Spread
   long     real_volume;  // Trade volume
  };

// retrieve mqlrates
void OnStart()
  {
   MqlRates rates[];
   int copied=CopyRates(NULL,0,0,100,rates);
   if(copied<=0)
      Print("Error copying price data ",GetLastError());
   else Print("Copied ",ArraySize(rates)," bars);
  }

... then all you have to do is to start a for-loop on rates[x].spread ...

edit : you may also try with arraymax ... maybe by coping it into the array or something like that - i don't remember exactly how i did it

Keith Watford
Moderator
24386
Keith Watford  
Icham Aidibe:

https://docs.mql4.com/constants/structures/mqlrates

Was doubting about mt4, but here it is. It's possible to retrieve the higher spread on a pre-defined interval by using mqlrates :

... then all you have to start a for loop on rates[x].spread

If I remember correctly, spread and real volume have never worked.

Just accidentally included when OnCalculate etc was introduced to MQL4

Unless of course they have changed it since I last checked.

EDIT: I just realised that you are referring to MqlRates, I was thinking of OnCalculate. Still, I'm surprised  it has the historic spread.

123
To add comments, please log in or register