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.
i have find out the problem. you can see below.
'TimeCurrent' - function is not defined F:\Program Files\MetaTrader - North Finance\experts\Daily range and locking trade.mq4 (78, 7)
AFAIK that command was introduced in build 200, so probably you use a bit old version of MT. Try to update it.
Quote:
Originally Posted by indratime
Take profit when all order (sell limit and buy limit) have executed. thats why this system call locking trade.
You mean close both orders at the moment the second one executed, don't you?
Quote:
Originally Posted by indratime
i use MACD for knowing big trend in daily.
If UPTREND Buy limit -10pips from open price and sell limit +20pips from open price.
Sorry, but still not clear for me - there are several ways to check up or down trend using MACD. Position of SIGNAL line you mentioned before is one of them.
You know, it's a very complicated problem for EA to answer a very simple question - uptrend or downtrend.
Take profit when all order (sell limit and buy limit) have executed. thats why this system call locking trade.
I got an idea... what the point to put two pending orders and wait both them to be executed just to close them? Under this strategy we constantly lose one spread on opening second order which we don't need.
So, the strategy should be:
at 0 hour check MACD and remember two price levels according to your rules about for up and down trend.
If price goes down and hit bottom level - open buy with SL 50 and TP 30,
If price goes up and hit top level - open sell with SL 50 and TP 30.
If close order at 23.30 if it is still exist (not closed by SL or TP).
Following this rules we get the same result but lose only one spread.
I'll do this EA a bit later.
Ok, it's profitable. Not superprofitable, but it works.
I tested it on EURUSD - not bad at all. Good profit factor, good payoff, resonable drawdown. It works pretty good without any optimisation.
If you try to optimise StartHour, SL and step a side levels, it may double the profit.
Hello ...its work now
yeah its still not the best system i think. But not bad isn't.
Thanks for youe hlep timbobo, i want to try it with forward test for 3 month.
i'll post here if i have a good result
I had a quick glance at the code: should the second "BUY_LEVEL = 0;" (when opening a short) rather be "SELL_LEVEL = 0;" ?
It does not matter. The logic is following
1. Set two levels - buy and sell
2. Wait till price hit one of these levels.
3. After that open proper order and delete both levels from memory as we open only one order per day.
So if BUY_level = 0, it means that the order was already opened and we should do nothing and wait the starting hour when new levels will be set. After opening order BUY_level loses his meaning as price level and becames a flag "all done for today, relax and don't try to open anything else"
4. 23.5 hour after starting hour open order (if still exists) will be closed on market price.
My EA has a mistake. It takes MACD from the first bar (number 0) but it is not finished yet. That's not right. To fix it you can change code:
double myMACD = iMACD(NULL, PERIOD_D1, fast_ema_period, slow_ema_period, signal_period, applied_price, MODE_MAIN, 0);
double mySignal = iMACD(NULL, PERIOD_D1, fast_ema_period, slow_ema_period, signal_period, applied_price, MODE_SIGNAL, 0);
the last figure should be 1 not 0.
Or you can change in settings applied_price to 1 (Open price)
All these stuff does make great difference but that's how it should be.
My EA has a mistake. It takes MACD from the first bar (number 0) but it is not finished yet. That's not right. To fix it you can change code:
double myMACD = iMACD(NULL, PERIOD_D1, fast_ema_period, slow_ema_period, signal_period, applied_price, MODE_MAIN, 0);
double mySignal = iMACD(NULL, PERIOD_D1, fast_ema_period, slow_ema_period, signal_period, applied_price, MODE_SIGNAL, 0);
the last figure should be 1 not 0.
Or you can change in settings applied_price to 1 (Open price)
All these stuff does make great difference but that's how it should be.
hi, I ran the EA but it did not open any orders. Please help.
I got an idea... what the point to put two pending orders and wait both them to be executed just to close them? Under this strategy we constantly lose one spread on opening second order which we don't need.
So, the strategy should be:
at 0 hour check MACD and remember two price levels according to your rules about for up and down trend.
If price goes down and hit bottom level - open buy with SL 50 and TP 30,
If price goes up and hit top level - open sell with SL 50 and TP 30.
If close order at 23.30 if it is still exist (not closed by SL or TP).
Following this rules we get the same result but lose only one spread.
I'll do this EA a bit later.
Hello Timbobo,
can you please explain your version verses Indratime's version , looks like your is a slight modification?