Can I ask what MA settings you used ?hello, im backtesting this ea on mt5 with my settings, here are results on real tick data of last 4 months
but it lost last year on same settings
Discuss Adjustable MA expert advisor. Adjustable MA is a highly flexible moving average cross EA. You can ask any questions about this expert advisor here.
Check what it outputs in the Experts tab. Perhaps it didn't have enough time to open a position yet?This Adjustable EA is not opening trade in my demo account. It's working very well on tester. I use Deriv zero spread account, please help!
//-----Noticed your interest, Enivid ... Are you able to implement my ideas ?
Have also noticed whilst testing that my asset does not like to trade Tuesdays or Thursdays
bool CheckTime() { if ((TimeCurrent() >= StringToTime(StartTime)) && (TimeCurrent() <= StringToTime(EndTime) + 59) ) // Using +59 seconds to make the minute time inclusive. { return true; } return false; } bool CheckDay() { if ( ((DayOfWeek() == 1) && Monday) || ((DayOfWeek() == 2) && Tuesday) || ((DayOfWeek() == 3) && Wednesday) || ((DayOfWeek() == 4) && Thursday) || ((DayOfWeek() == 5) && Friday) ) { return true; } return false; } // never can remember how to spell wendsday
Yeah, but that won't happen soon.Noticed your interest, Enivid ... Are you able to implement my ideas ?
Yeah, but that won't happen soon.
//-------One of my biggest regrets in life, if not THE biggest, is not learning how to write code
input bool DoTrailingOutsideTradingTime = true; input bool Monday = false; input bool Tuesday = false; input bool Wednesday = false; input bool Thursday = false; input bool Friday = false; if(CheckDay()) { CheckCross(); }
If you set TakeProfit to 0, it will only close a trade on the next cross. If you want it to add take-profit only after a cross, this EA cannot do it.How would I set the EA to run until the next MA cross before taking profits ?
It sets the trailing stop distance. The stop-loss will be moved closer to the current price as the current price moves in the trade's favor.What does "TrailingStop" do
It starts immediately after the trade is opened.and at what point does the trailing stop start
The distance you set via that parameter.and how far behind does it trail ?
When, presumably, it will open a trade in the opposite direction ?If you set TakeProfit to 0, it will only close a trade on the next cross
This EA has a very simple trailing stop function, so just one parameter to define the SL distance and no way to delay its triggering until some amount of profit is reached.Thank you, @Enivid, for your clear instructions 🙂 In the past, I have been faced with 2 or 3 inputs for a trailing stop
Yes, that's right.When, presumably, it will open a trade in the opposite direction ?
The EA fails to initialize when the period of the period of the fast MA equals the period of the slow MA. During the optimization, if you set overlapping ranges for the periods, this will happen. It shouldn't be a problem.I got this in my log (one of many) following the optimisation of my modified "Adjustable_MA"
Core 3 genetic pass (1, 319) tested with error "OnInit returned non-zero code 1"
Google explains it as
The error "Core 3 genetic pass (1, 319) tested with error OnInit returned non-zero code 1" in the MetaTrader 5 strategy tester indicates that the Expert Advisor (EA) failed to initialize during a genetic algorithm optimization. Specifically, the OnInit() function within the EA returned a non-zero code, signaling an initialization error. The "Core 3 genetic pass (1, 319)" part refers to the specific genetic algorithm iteration and the parameters being tested.
Some of the other numbers (2,275) (2,278) (2,439) (3,355) (3,416) (3,385) (3,359) (3,416) …
To be 100% sure the fault was not in my new code, I ran an original copy of "Adjustable_MA", optimising Period_1 and Period_2 and got the attached log
Please advise
Thanks ... I will run the strategy tester without optimising the MA periods and see what happensThe EA fails to initialize when the period of the period of the fast MA equals the period of the slow MA. During the optimization, if you set overlapping ranges for the periods, this will happen. It shouldn't be a problem.