There was an error in the check_freezelevel.mq5 file code (line 140) missing the `if(!TP_check)` statement
bool CheckPositionForFREEZE_LEVEL(ulong ticket)
{
//--- get the SYMBOL_TRADE_FREEZE_LEVEL levelint freeze_level=(int)SymbolInfoInteger(_Symbol,SYMBOL_TRADE_FREEZE_LEVEL);
if(freeze_level!=0)
{
PrintFormat("SYMBOL_TRADE_FREEZE_LEVEL=%d: Cannot modify order"+
" nearer than %d points from the activation price",freeze_level,freeze_level);
}
//--- select position for workingif(!PositionSelectByTicket(ticket))
{
//--- failed to select positionreturn(false);
}
//--- get the order data ENUM_POSITION_TYPE pos_type=(ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
double sl=PositionGetDouble(POSITION_SL);
double tp=PositionGetDouble(POSITION_TP);
//--- result of checking StopLoss and TakeProfitbool SL_check=false,TP_check=false;
//--- position typeswitch(pos_type)
{
//--- buycasePOSITION_TYPE_BUY:
{
SL_check=(Bid-sl>freeze_level*_Point);
if(!SL_check)
PrintFormat("Position %s #%d cannot be modified: Bid-StopLoss=%d points"+
" < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
EnumToString(pos_type),ticket,(int)((Bid-sl)/_Point),freeze_level);
TP_check=(tp-Bid>freeze_level*_Point);
if(!TP_check)
PrintFormat("Position %s #%d cannot be modified: TakeProfit-Bid=%d points"+
" < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
EnumToString(pos_type),ticket,(int)((tp-Bid)/_Point),freeze_level);
//--- return the result of checkingreturn(SL_check&&TP_check);
}
break;
//--- sellcasePOSITION_TYPE_SELL:
{
SL_check=(sl-Ask>freeze_level*_Point);
if(!SL_check)
PrintFormat("Position %s cannot be modified: StopLoss-Ask=%d points"+
" < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
EnumToString(pos_type),(int)((sl-Ask)/_Point),freeze_level);
TP_check=(Ask-tp>freeze_level*_Point);
PrintFormat("Position %s cannot be modified: Ask-TakeProfit=%d points"+
" < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
EnumToString(pos_type),(int)((Ask-tp)/_Point),freeze_level);
//--- return the result of checkingreturn(SL_check&&TP_check);
}
break;
}
//--- position did not pass the checkreturn (false);
}
Hello, My EA trades based on news events and it doesn't work in the strategy tester but it is profitable in the live account. Will my EA not working in the tester make it fail the market validation
In general, checking the TakeProfit and StopLoss levels with the minimum distance ofSYMBOL_TRADE_STOPS_LEVELtaken into account looks as follows:
Buyingis done at the Ask price — the TakeProfit and StopLoss levels must beat the distance of at least SYMBOL_TRADE_STOPS_LEVEL points from the Bid price.
Sellingis done at the Bid price — the TakeProfit and StopLoss levels must beat the distance of at least SYMBOL_TRADE_STOPS_LEVEL points from the Ask price.
Can someone please explain the doubt that I'm having?
I understand that buying is done on the ask price, and selling is done on the bid price. I also can understand why we're using bid price to compare when buying for stop loss and take profit (because we'll be taking the opposite trade, selling, thus bid price).
However, I don't understand why the take profit doesn't also get compared to the ask price when buying, because if we only compare it to the bid price, user could potentially set the value higher than the bid price but lower than the ask price, which totally doesn't make any sense?
my EA is declined because the validation reports "no trading activities". As my EA is designed to trade at a specific news date I would need to know what historical data is used during EA validation. Then I coudl provide a default date for validation purposes.
@Tim Arthur Herbert Kasprzyk#: my EA is declined because the validation reports "no trading activities". As my EA is designed to trade at a specific news date I would need to know what historical data is used during EA validation. Then I coudl provide a default date for validation purposes.
It seems you did not read this topic before posting ...
As per the Market product rules, you are not allowed to restrict or limit your EA to a single symbol. Your EA must work for all symbols, even if its intended use is for a single symbol.
You are not allowed to limit your EA in any way. It must be able to trade on anything an everything, even if it was designed for indices. Please read the Market rules.
It seems you did not read this topic before posting ...
Hi Fernando, thanks for your feedabck. Actually my EA is not restricted to any symbol, or timeframe. It only requires a specified news date like FED interest rate news date. I also provide a default news date in the EA. So in theory it should pass the validation. But it might be the case that the validation process is using historical data which is not covering my default date. THerefor it would be helpful to understand which historical data is used (not which symbol or timeframe, this I can see in the report).
@Tim Arthur Herbert Kasprzyk#: Hi Fernando, thanks for your feedabck. Actually my EA is not restricted to any symbol, or timeframe. It only requires a specified news date like FED interest rate news date. I also provide a default news date in the EA. So in theory it should pass the validation. But it might be the case that the validation process is using historical data which is not covering my default date. THerefor it would be helpful to understand which historical data is used (not which symbol or timeframe, this I can see in the report).
It is still a limitation. Remove any and all limitations by setting the default parameter values to allow trading irrespective of any given date, symbol, or time-frame.
The EA will also need to read the contract specifications and adjust accordingly, or else it will fail the validation process.
I get the message "Strategy TesterReport not found" EURUSD 1H. How can I solve this?
I've checked many times in strategy tester and my EA works without any errors.
I coded a "Validation Test" EA that simply opens a position with minimum allowed volume and closes the position after a few seconds, but same error did happen.
Just read a comment regarding validation report saying "no trading activities". Must all EAs trade? My EA is just drawing stuffs on the chart, or it should had been an Indicator?
Anyone with this type of problem? In the Metaquotes DEMO account it works normally and in the test it did not pass validation.
test on EURUSD,H1 (netting) 2021.06.30 23:59:59 ExpertRemove() function called removed itself within OnDeinit removed itself on 99% of testing interval strategy tester report 1 total trades
There was an error in the check_freezelevel.mq5 file code (line 140) missing the `if(!TP_check)` statement
In general, checking the TakeProfit and StopLoss levels with the minimum distance of SYMBOL_TRADE_STOPS_LEVEL taken into account looks as follows:
Bid - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL
StopLoss - Ask >= SYMBOL_TRADE_STOPS_LEVEL
Can someone please explain the doubt that I'm having?
I understand that buying is done on the ask price, and selling is done on the bid price. I also can understand why we're using bid price to compare when buying for stop loss and take profit (because we'll be taking the opposite trade, selling, thus bid price).
However, I don't understand why the take profit doesn't also get compared to the ask price when buying, because if we only compare it to the bid price, user could potentially set the value higher than the bid price but lower than the ask price, which totally doesn't make any sense?
Thanks for your time.
Hi,
my EA is declined because the validation reports "no trading activities". As my EA is designed to trade at a specific news date I would need to know what historical data is used during EA validation. Then I coudl provide a default date for validation purposes.
Thanks in advance
Tim
It seems you did not read this topic before posting ...
It seems you did not read this topic before posting ...
It is still a limitation. Remove any and all limitations by setting the default parameter values to allow trading irrespective of any given date, symbol, or time-frame.
The EA will also need to read the contract specifications and adjust accordingly, or else it will fail the validation process.
I've checked many times in strategy tester and my EA works without any errors.
I coded a "Validation Test" EA that simply opens a position with minimum allowed volume and closes the position after a few seconds, but same error did happen.
Just read a comment regarding validation report saying "no trading activities". Must all EAs trade? My EA is just drawing stuffs on the chart, or it should had been an Indicator?
Anyone with this type of problem? In the Metaquotes DEMO account it works normally and in the test it did not pass validation.
test on EURUSD,H1 (netting) 2021.06.30 23:59:59 ExpertRemove() function called removed itself within OnDeinit removed itself on 99% of testing interval strategy tester report 1 total trades