metatrade chart bug whit widen spread??? it damages my EA...please help!!! - page 2

 
BarrowBoy:

ladygaga

loved your last release, ace video :)

Re MetaTrader - Bid & Ask are always available, they will (on NDD brokers) always be liable to move independently

So I know if either reaches a certain level and act accordingly as relevant

Mid-point only is a false picture, all is dynamic in the market, its not supposed to be tidy so my EA's use that movement

FWIW

-BB-

Hi BarrowBoy I will hire You to my next video lol,

mid point is also deceptive but what is more deceptive?? mid or bid only chart- when we assume that spread can be 2 pips and also 60 pips before payrolls???

some economic data are not so important and maket is flat before and after release...NO REACTION -but that widen spread make intraday chart flawed I see on bloomberg flat all the time and metatrade shows me huuuge plunge 30 pips!!!

It should be an option, that everyone can choose what is high low open close of the bar, if it is bid, ask or mid....

 

Hi ladygaga

You need to keep in mind that the broker is also in business to make money. Since you are trading though his data feed, he will control the spread. Like BarrowBoy says, even the midpoint (like I mentioned before) will not give you what you want.

You need to test the datafeed that your broker provides to see how the spread varies during the day.

This can be done with a simpple piece of code that logs the spread everytime it changes. You can then evaluate the results after some time and decide if you are satisfied with the data that your broker offers. ON average during a normal trading day (no bank holidays causing low trading volumes) your broker will most likely keep the spread constant during business hours (in the little hours of the night when volume is low the spread is likely to vary and during impartant news event it is possible that our broker may use either the spread or the stoplevel and /or freezelevel to protect himself)

Code that I use to check market conditions look like this:

static bool first = true;
static int pre_Spread = -1;
static int pre_StopLevel = -1;
static int pre_FreezeLevel = -1;
static bool pre_TradeAllowed = 0;
int cur_Spread = -1;
int cur_StopLevel = -1;
int cur_FreezeLevel = -1;
bool cur_TradeAllowed = 0;

if ( first==true )
{
pre_Spread=MarketInfo(Symbol(),MODE_SPREAD);
pre_StopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
pre_FreezeLevel=MarketInfo(Symbol(),MODE_FREEZELEVEL);
pre_TradeAllowed=MarketInfo(Symbol(),MODE_TRADEALLOWED);
first=false;
}
if (first!=true)
{
cur_Spread=MarketInfo(Symbol(),MODE_SPREAD);
cur_StopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
cur_FreezeLevel=MarketInfo(Symbol(),MODE_FREEZELEVEL);
cur_TradeAllowed=MarketInfo(Symbol(),MODE_TRADEALLOWED);
}

if (first!=true)

{

if ((pre_StopLevel!=cur_StopLevel)||(pre_FreezeLevel!=cur_FreezeLevel)||(pre_TradeAllowed!=cur_TradeAllowed)||(pre_Spread!=cur_Spread))
{
Print("Change in MarketInfo");
Print("Spread="+cur_Spread+"; StopLevel="+cur_StopLevel+"; FreezeLevel="+cur_FreezeLevel+"; TradeAllowed="+cur_TradeAllowed);
pre_Spread=cur_Spread;
pre_StopLevel=cur_StopLevel;
pre_FreezeLevel=cur_FreezeLevel;
pre_TradeAllowed=cur_TradeAllowed;
}
}

I also set an acceptable spread variable that is tested before I place any trades like this:

if (spread <= acceptable_spread)

{

code to place trades

}

Hope that helps

whocares

 
whocares:

Hi ladygaga

You need to keep in mind that the broker is also in business to make money. Since you are trading though his data feed, he will control the spread. Like BarrowBoy says, even the midpoint (like I mentioned before) will not give you what you want.

You need to test the datafeed that your broker provides to see how the spread varies during the day.

This can be done with a simpple piece of code that logs the spread everytime it changes. You can then evaluate the results after some time and decide if you are satisfied with the data that your broker offers. ON average during a normal trading day (no bank holidays causing low trading volumes) your broker will most likely keep the spread constant during business hours (in the little hours of the night when volume is low the spread is likely to vary and during impartant news event it is possible that our broker may use either the spread or the stoplevel and /or freezelevel to protect himself)

Code that I use to check market conditions look like this:

static bool first = true;
static int pre_Spread = -1;
static int pre_StopLevel = -1;
static int pre_FreezeLevel = -1;
static bool pre_TradeAllowed = 0;
int cur_Spread = -1;
int cur_StopLevel = -1;
int cur_FreezeLevel = -1;
bool cur_TradeAllowed = 0;

if ( first==true )
{
pre_Spread=MarketInfo(Symbol(),MODE_SPREAD);
pre_StopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
pre_FreezeLevel=MarketInfo(Symbol(),MODE_FREEZELEVEL);
pre_TradeAllowed=MarketInfo(Symbol(),MODE_TRADEALLOWED);
first=false;
}
if (first!=true)
{
cur_Spread=MarketInfo(Symbol(),MODE_SPREAD);
cur_StopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
cur_FreezeLevel=MarketInfo(Symbol(),MODE_FREEZELEVEL);
cur_TradeAllowed=MarketInfo(Symbol(),MODE_TRADEALLOWED);
}

if (first!=true)

{

if ((pre_StopLevel!=cur_StopLevel)||(pre_FreezeLevel!=cur_FreezeLevel)||(pre_TradeAllowed!=cur_TradeAllowed)||(pre_Spread!=cur_Spread))
{
Print("Change in MarketInfo");
Print("Spread="+cur_Spread+"; StopLevel="+cur_StopLevel+"; FreezeLevel="+cur_FreezeLevel+"; TradeAllowed="+cur_TradeAllowed);
pre_Spread=cur_Spread;
pre_StopLevel=cur_StopLevel;
pre_FreezeLevel=cur_FreezeLevel;
pre_TradeAllowed=cur_TradeAllowed;
}
}

I also set an acceptable spread variable that is tested before I place any trades like this:

if (spread <= acceptable_spread)

{

code to place trades

}

Hope that helps

whocares

ok thx for code whocares

Reason: