i have an EA, codeA.ex5 i have made all the necessary checks but this EA fails the automatic validation with errors(no trading operations) for all the test pairs
when i copy the exact code and paste and compile with the same editor to codeB.ex5, this code passes the validation with no errors
then i copy the code from codeB, modify the some few lines, to codeC.ex5. but codeC.ex5 fails automatic validation(no trading operations) too
so i copy the exact code from codeB to codeC, with no modifications, but this code also fails automatic validation (no tradding operations)
what is going on? any help?
this is the section of my code that places the pending orders
double max_volume=SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_LIMIT);
double current_lots=getAllVolume(); // get total volume of all positions and orders of current symbol
if(orderType=="buy")
{
double orderTP = NormalizeDouble(orderEntry + ((orderEntry-orderSL)*rr), _Digits);
double buyLot = calcLotSize(orderEntry, orderSL, ORDER_TYPE_BUY);
if(max_volume>0 && max_volume-current_lots-buyLot<=0)
returnfalse;
if(orderEntry-ask>=freezeLevel*_Point) // removing this line causes invalid price error
result = m_trade.BuyStop(NormalizeDouble(buyLot, 2), NormalizeDouble(orderEntry, _Digits), _Symbol, NormalizeDouble(orderSL, _Digits), orderTP, ORDER_TIME_GTC, 0, "FVG");
}
if(orderType=="sell")
{
double orderTP = NormalizeDouble(orderEntry - ((orderSL-orderEntry)*rr), _Digits);
double sellLot = calcLotSize(orderEntry, orderSL, ORDER_TYPE_SELL);
if(max_volume>0 && max_volume-current_lots-sellLot<=0)
returnfalse;
if(bid-orderEntry>=freezeLevel*_Point) // removing this line causes invalid price error
result = m_trade.SellStop(NormalizeDouble(sellLot, 2), NormalizeDouble(orderEntry, _Digits), _Symbol, NormalizeDouble(orderSL, _Digits), orderTP, ORDER_TIME_GTC, 0, "FVG");
}
this is the section of my code that places the pending orders
Update:
i had this error trying to upload my EA