I came across this interesting EA in the archives but cannot get it to trade on backtest.
Any assistance? Or is it not able to be traded on backtest?
I didn't bother posting in the original thread since it is too old.
Thanks
I suspect that you are having problems with the Load and Save of the NN, as it does not tell you if the file operation was succesfull. Check to see if the files are present in the Tester file folder, or display e message if the file operation was not successfull.
KomodoDragon
WHEN ALL ELSE FAILS, READ THE INSTRUCTIONS!
I came across this interesting EA in the archives but cannot get it to trade on backtest.
total = OrdersTotal(); if(total!=0)return(0);
This makes the EA incompatible with any other including itself on other chartsint count=0; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. count++; } if (count=0) return(0);
OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, Ask - STOP_LOSS * Point, Ask + LIMIT * Point, NULL, 16384, 0, Green); if(iHigh(NULL, 0, begin)>=Price+SL*Point)
EA must adjust for 5 digit brokers, TP, SL, AND slippage. On ECN brokers you must orderSend and THEN set stops.//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
Always check return codes so you know WHY it doesn't workif (OrderSend(...) < 0) Alert("OrderSend failed: ",GetLastError());
@gjrexach: When I run a backtest the graph and order history is blank but I don't get any error messages.
@WGRoeder: That may be the problem-- I have a 5-digit ECN broker
Did you make the changes that i recommended? You dont know whether you have an OrderSend problem until you execute OrderSend, and if you did execute an OrderSend that was rejected, (yours & WH/WGRoeders assumption), you would know by looking at the Log file, even without ..Roeders code changes. Start debugging at the beginning and not in the middle of the code.
The reason your EA is not trading is exactly what I suspected.
PNN1 ClassifyVector returns -1 if some error exists with the NN.
ERGO, No trade will be sent because you are testing for 0 and 1.
int class1 = PNN1ClassifyVector(dataR);
if (class1 == 0)
{
OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, Ask - STOP_LOSS * Point, Ask + LIMIT * Point, NULL, 16384, 0, Green);
}
if (class1 == 1)
{
OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, Bid + STOP_LOSS * Point, Bid - LIMIT * Point, NULL, 16384, 0, Red);
}

- 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 came across this interesting EA in the archives but cannot get it to trade on backtest.
Any assistance? Or is it not able to be traded on backtest?
I didn't bother posting in the original thread since it is too old.
Thanks