Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
Well, I have tried to clean up and update the code, to include updates from NEO, as well as add the LWMA. Here it is explained.
Trend is the internal value that is checked against the bid/ask. It uses the MAPeriod.
MAPeriod - A friend of mine determined that he liked using 15M TF 80 LWMA to place the orders, I converted it to a 1M TF 1200 LWMA (15*80) Buys above this and sells below.
Everything else is pretty much the same.
The close routines are still screwing up a bit. Sometimes the positive buys above the midpoint will close out a losing sell, sometimes not. same for the sells below the midpoint. Errrr. Can still use some help with this aspect.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
By putting in PERIOD_M1, you are locking in the 1M timeframe no matter what. I was even thinking of having a couple of externs so people could customize the MA, like one for TF and one for type of MA.
Nice catch on the brackets. I didn't think that would matter.
The closes are still not 100% doing what they are supposed to doing. Same situation above buys and below sells not closing out the losing opposite order all the time.
I think I have an idea about the improper closings. I added a HighestBuyTicket and LowestSellTicket to the comment block and noticed when I ran the backtester the tickets weren't reseting like they should. Maybe this might give us some new area of thought. Maybe a whole subroutine to refresh all the variables once profit is taken.
Next, try connecting the "if"s in the close analysis section with "else"s - I'm convinced that is where the main issue lies (might also be worth calculating MidPoint unconditionally)....
I added in some auditing code the to version I'm playing with and it was throwing out all sorts of errors before I made these changes. Now there are none being generated and opposite orders appear to be closing correctly.
neo, will you please post the ea with changes? there have been several changes proposed by various members and it's getting difficult to keep track now of what all of the changes are.
The reason I didn't post the entire EA previously is that I generally "rewrite" EAs in my own formatting style which helps me work out what's going on. I also generally rename variables and functions, though that may just be OCD
Anyway, the major deviation from Don's version is that I grafted the magic number routine from Fifth's Blessing code and added error reporting to a text file. There are a few minor revisions too but the most important is that I added the trend filtering into the Start() function.
I've got a sneaking suspicion that the Martingale side of things isn't working correctly but that's no big shakes at the moment.
Opps... almost forgot! I converted all neccesary "extern bool" parameters into "extern int" so that you can use them in optimisation mode in the strategy tester (0 = false, 1 = true) - the boolean code is just commented out throughout so you can switch it back if you want.
If you find any other issues then I guess you'll let me know