is there any method to verify this Expert.

 

I coded an expert advisor. it's works on indices, not in currency pairs. but in the verification process, it only be tested on EURUSD pair. which 100% have issues when the EA operation. is there any method to process this EA for a indices? 



 
Even if your goal is to make it only work for indices, make your code more 'abstract' so it also works for any symbol - and specify in the EA description it was designed for indices. For example, let's say your EA only works for stocks and you hardcode the tp/sl values so it always buy at $10.00 and sells at $11.00. That would cause it to not be validated because it would not pass currencies tests. Make it more abstract and always take into consideration the tick step (minimum price movement value) to define your entry price and tp/sl, the minimum and maximum volume and the volume step (minimum volume increment), etc., and not only the target market specifications. Doing this the validation will be successful.
 
Hapu Arachchilage Tharindu LakmalI coded an expert advisor. it's works on indices, not in currency pairs. but in the verification process, it only be tested on EURUSD pair. which 100% have issues when the EA operation. is there any method to process this EA for a indices? 

Regarding this specific error [Invalid stops], you should always do the checks below before opening or modifying positions:

 
Hapu Arachchilage Tharindu Lakmal:

I coded an expert advisor. it's works on indices, not in currency pairs. but in the verification process, it only be tested on EURUSD pair. which 100% have issues when the EA operation. is there any method to process this EA for a indices? 




in the description, I've clearly highlighted that. 
 
Vinicius Pereira De Oliveira #:

Regarding this specific error [Invalid stops], you should always do the checks below before opening or modifying positions:

This automatic validation system is a bullshit... look at this, I've filtered order placing using multiple filters... but the validation system bypass all the filters and still places many trades. 
even though it says "Invalid volume" for 0.01 lot in gold with 10 pips sl... 

I tried 1 lot / 0.05 lot / 2 lot ... still failed and prints "Invalid volume". 


here are the codes that uses to place trades. 


MarginCurrency = SymbolInfoString(_Symbol,SYMBOL_CURRENCY_MARGIN);
ProfitCurrency = SymbolInfoString(_Symbol,SYMBOL_CURRENCY_PROFIT);

//OnTick Event Functions (Trade Opening)
if(LastClosedProfit > DDLimit && MarginCurrency == "USD" && ProfitCurrency == "USD") // Not hit DD
  {
   trade.Buy(Volume, NULL, ask, Low1, 0, NULL);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
if(LastClosedProfit > DDLimit && MarginCurrency == "USD" && ProfitCurrency == "USD") // Not hit DD
  {
   trade.Sell(Volume, NULL, bid, High1, 0, NULL);
  }
//+------------------------------------------------------------------+

In this code, there is no issue with the code... I teseted it multiple times. varibles used in this code are calclulated precisely. Even I used Base and quote currency filters to skip pairs like XAUUSD.
because the Margin currency for XAUUSD is XAU


I used to alter to check either these filters are works or not, they work without an issue. In order to pass the test, I added code line to execute only one trade regardless of the symbol. with that code, I executed a trade with SL TP. one trade for entire test. 
I don't know how this system bypass this filter... I'm tired of fixing... right now. The EA works pretty fine. but this validation system... 

I decided it to work on account that have balance above 1000$. this validation system always use 1000$ account balance. 

here are the codes that places only one trade for entire testing. 

OneTimeTrade ++;
double Entry = ask - NormalizeDouble(500.0 * Point(),_Digits);
double SL = Entry - NormalizeDouble(100.0 * Point(),_Digits);
double TP = Entry + NormalizeDouble(800.0 * Point(),_Digits);

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
if(OneTimeTrade == 5)
  {
   trade.BuyLimit(Volume - 4,Entry,NULL,SL,TP,ORDER_TIME_GTC);
  }

varibale OneTimeTrade is delcreated in global scale and updates inside onTick() function. 

 

Entry price is Ok... SL is valid... Tp is valid.. still invalid volume.



 
Hapu Arachchilage Tharindu Lakmal #This automatic validation system is a bullshit... look at this, I've filtered order placing using multiple filters... but the validation system bypass all the filters and still places many trades.  even though it says "Invalid volume" for 0.01 lot in gold with 10 pips sl...  I tried 1 lot / 0.05 lot / 2 lot ... still failed and prints "Invalid volume".  [ . . . ]

Regarding error [Invalid volume], see the comment below:

Forum on trading, automated trading systems and testing trading strategies

Desperate "No trading operations" error

Vinicius Pereira De Oliveira, 2024.04.21 14:42

It must be corrected, Juan. For example: if the EA uses a fixed volume parameter and by default this volume is set at 0.01, but during validation testing the tested symbols do not allow volume 0.01, then the EA does not open a position and will not be able to be published. So, to avoid this problem, you can use a function like the following, in addition to the volume checks recommended in the article:

//+--------------------------------------------------------------------------------------------------------------------+
//| This function normalizes the volume according to the minimum volume change step                                    |
//+--------------------------------------------------------------------------------------------------------------------+
double NormalizeVolume(double Lot)
  {
   ResetLastError();
//--- Minimal and maximal allowed volume for trade operations
   double LotMin  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
   double LotMax  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
//--- Get minimal step of volume changing
   double LotStep = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);

//--- Check if an execution error occurred
   if(GetLastError() != ERR_SUCCESS)
     {
      return(WRONG_VALUE);
     }

//--- Normalizes the volume
   Lot = LotMin + MathFloor((Lot - LotMin) / LotStep) * LotStep;
   Lot = NormalizeDouble(MathMin(LotMax, MathMax(LotMin, Lot)), 2);

//--- Normalized volume
   return(Lot);
  }

 
Vinicius Pereira De Oliveira #:

Regarding error [Invalid volume], see the comment below:


Validation system shows invalid volume, but strategy tester placed the trade as it is. 





 

 
Hapu Arachchilage Tharindu Lakmal #Validation system shows invalid volume, but strategy tester placed the trade as it is.  

The validation system symbols have different specifications... There's no point fighting with the system, you have to correct the problem...

 
Vinicius Pereira De Oliveira #:

The validation system symbols have different specifications... There's no point fighting with the system, you have to correct the problem...

is there any way to know those specs ?.

 
Hapu Arachchilage Tharindu Lakmal #is there any way to know those specs ?.

I don't think so, since one of the purposes of these tests is to evaluate whether the EA is able to trade flawlessly in different market situations, so I don't think it would make sense to disclose in which situations the EA will be tested, right ?... So, were you able to implement volume checks and volume normalization ? Are you having difficulties ?

Reason: