Regarding this specific error [Invalid stops], you should always do the checks below before opening or modifying positions:
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.
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.
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); }
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 ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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?