Daily range and locking trade? - page 2

 
indratime:
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.

Files:
 

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;" ?

 
ralph.ronnquist:
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.

 
timbobo:
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 am using Alpari platform.

 

Can U please explain the concept behind this system ,Indratime?

thanks

 
timbobo:
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?

 
teldon:
Hello Timbobo, can you please explain your version verses Indratime's version , looks like your is a slight modification?

There is no difference between original Indratime's idea and my last modification. That's just how I follow his idea. He used two pending orders, I offered to use virtual pending orders - just two levels in memory of EA. This approach allows us to save one spread as we don't need to wait while both orders executed. That's it.

Reason: