Phoenix 2007 (new thread) - page 118

 

Bug report

FXDD

Forward testing DEMO

v 5.6.8

EUR/USD

I had that problem earlier today:

2006.12.14 11:59:00 '482438': modification of order #5158521 buy 0.40 EURJPY at 154.8900 sl: 154.0900 tp: 155.5900 -> sl: 154.8900 tp: 155.5900 failed

It cause the 2 others trades to close at 0. I closed the first order manually at 0.

2006.12.14 14:45:17 '482438': close order #5158520 buy 0.40 EURJPY at 154.8900 sl: 154.0900 tp: 155.2400 at price 154.8900

2006.12.14 11:59:08 '482438': order #5158522 buy 0.40 EURJPY at 154.8900 was modified -> sl: 154.8900 tp: 155.9400

2006.12.14 11:59:08 '482438': request in process

2006.12.14 11:59:08 '482438': request was accepted by server

2006.12.14 11:59:08 '482438': modify order #5158522 buy 0.40 EURJPY at 154.8900 sl: 154.0900 tp: 155.9400 -> sl: 154.8900 tp: 155.9400

2006.12.14 11:59:07 '482438': order #5158521 buy 0.40 EURJPY at 154.8900 was modified -> sl: 154.8900 tp: 155.5900

2006.12.14 11:59:07 '482438': request in process

2006.12.14 11:59:07 '482438': request was accepted by server

2006.12.14 11:59:07 '482438': modify order #5158521 buy 0.40 EURJPY at 154.8900 sl: 154.0900 tp: 155.5900 -> sl: 154.8900 tp: 155.5900

 

Post error

Sorry, pair mistake on previous post...

EUR/JPY

 

p568 testing

20:43:03 Phoenix_EA_v5_6_08 USDJPY,M15: open #2061919955 sell 0.10 USDJPY at 117.8300 sl: 118.6700 tp: 117.6200 ok

20:43:03 Phoenix_EA_v5_6_08 USDJPY,M15: open #2061919958 sell 0.10 USDJPY at 117.8300 sl: 118.6700 tp: 117.4100 ok

20:43:08 Phoenix_EA_v5_6_08 USDJPY,M15: open #2061919959 sell 0.10 USDJPY at 117.8300 sl: 118.6700 tp: 117.2000 ok

20:43:08 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

20:43:08 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

20:43:09 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

20:43:09 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

20:43:27 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

20:43:27 Phoenix_EA_v5_6_08 USDJPY,M15: OrderModify 2 - Error # 130

as you can see, ea opens 3-usdjpy and then displays errors until now

i'll continue to control orders ...

giapel

 
autumnleaves:
Darak, I have done quite a bit of optimizing with Mode3 on the GainCapital tick data. Switched up to .8 as soon as it came out, but it reacts differently from .7a, so I'm not sure if the .7a results stand. Would it be of any help for you to see the journals from the tests? Perhaps you could point out settings that I am not using optimally, and you might find cases where the SL are not behaving as they should.

I changed 3 lines of code to properly set SL. THe logic should be the same, but the trades are supposed to be more profitable. The problem with optimizing buggy software is that we end up optimizing bugs more than trades. I would optimize Mode1 only, and then use those settings for whatever mode you wish to trade. Mode1 is pure logic, Mode2 and Mode3 shuffle trades around.

 
m6m6:

I had that problem earlier today:

2006.12.14 11:59:00 '482438': modification of order #5158521 buy 0.40 EURJPY at 154.8900 sl: 154.0900 tp: 155.5900 -> sl: 154.8900 tp: 155.5900 failed

It cause the 2 others trades to close at 0. I closed the first order manually at 0.

I honestly don't think Mode3 was ever intended or programmed to handle Trade2 and Trade3 if Trade1 was closed manually. Especially manually without a positive balance. If you close out Trade1 manually when the current price is near breakeven, all sorts of things might break horribly.

We've been focusing on fixing Mode3 for automated trading exclusively. I think that if people want to do a combination of manual+automated that Mode1 would be best. If you want a larger number of smaller trades to manually modify, decrease maximum risk and increase maxtrades.

 

Note

I closed it after the problem so I do not have a remaining open position that was suppose to be closed. I want the system to operate alone and be consistent as all of us. I post the error note so you can, me be, find something to solve the problem. Sorry if I confused you!

Persitence is the key and I am confident you guys will soon find the little glitch.

 

Mode3 still has errors. I'm working on them now. I don't like the way it was set up so I'm doing a major code revision instead of small tweaks. I'm looking at this and thinking that there are too many fragile parts. I'm eliminating global variables, history checking and a few other things. This is only valid on the assumption that all of the trades die together since they all have the same SL. If that changes we'll need to check history again. In the meantime, this is more reliable.

I'll be releasing 5.7.0 in a few hours.

 

Optimizing Mode 3

daraknor:
I would optimize Mode1 only, and then use those settings for whatever mode you wish to trade.

Thanks Daraknor, but I'm not sure I understand your recommendation. Optimize the inputs in the Mode 1 section, and then copy these numbers to the Mode 2 and Mode 3 sections of the inputs? Or just optimize Mode 1 and leave the other two alone? I found that each mode required considerable tweaking on all signals to obtain max performance.

The attached graph shows Mode 3 performance of version .07a with risk 0.05 (max drawdown less than 2%). Testing of version .8 does not come close to this, so it must be doing something very differently. With version .7a drawdown still less than 10% at risk 0.2. All this with actual tick data (if we trust GainCapital).

I would be much obliged for suggestions on how to approximate this kind of curve with version .8.

Files:
 

5.7.0 has been released.

I was tired of having buggy code, so I rewrote most of mode3 SL. The existing trade code is still used, but all of the detection code is completely rewritten. No more history inspection, no more intensive trade monitoring, no more global variables. The new 2 lines of code work much better and performed completely bug free in my 5 tests on 3 datasources.

The unbugged version of mode3 performs *MUCH* differently, so we should probably reoptimize. I did a quick optimize check and found that a setting of 1.4 was best, but 0.9*TP wasn't far behind. I set it to 0.8 so the trades are actually different. This is not "optimized" but it appears bug free. Some more tips for use are on the chargelog notes, post #151 of the dev thread. MQ4 file on the same spot for convenience.

 
autumnleaves:
Thanks Daraknor, but I'm not sure I understand your recommendation. Optimize the inputs in the Mode 1 section, and then copy these numbers to the Mode 2 and Mode 3 sections of the inputs? Or just optimize Mode 1 and leave the other two alone? I found that each mode required considerable tweaking on all signals to obtain max performance. I would be much obliged for suggestions on how to approximate this kind of curve with version .8.

Here is my current hunch and feeling, it is by no means gospel or absolutely right. Please feel free to accept/reject/debate as you see fit.

There are two main categories of optimizations. The first is profit curve fitting, the other is signal detection. If we do profit curve fitting, the optimizations are often short lived or dead on arrival. Optimizing for Mode3 will usually yield profit curve fitting optimizations. If you optimize for Mode1 then there is some profit curve fitting, but less so. Almost every good optimization set for mode 1 will work well in mode 3. The reason I say "almost" is due to the following:

If the Trade1 adjustment (T1adj) is too low, then there isn't enough room to let our trade go up down before exiting out Trade2 and Trade3 at breakeven stoploss. My suspicion was that T1adj = 0.5 (the previous setting) was too small, so I set it to 0.8. Now you at least collect 80% of the TP each trade instead of 50%.

Once the trade signals are optimized (mode1 testing) it would be useful to run those settings in Mode3. The extra trade/money management features in mode3 will probably take a system that was profitable in Mode1 and make it even more profitable.

Breakeven trades are only set on Trade2 and Trade3, never Trade1. If the last reminaing trade is Trade3, it will set 0.5*TP as the SL when it is the last trade.

If you want to only protect 1 trade and not 2 trades, set Trade 2 or 3 to be the lowest trade. For example, T1adj=1.0 T2adj=1.2 T3adj=0.8 will only set breakeven on Trade2. Setting T1adj=1.0 T2adj=0.8 T3adj=1.2 will keep T1 at normal SL, set T3 to have 0.5TP SL when T1 exists.

Another tactic, if you find that TP is regularly hit using Mode1 optimization is to set T1adj=1.0 T2adj=1.5 T3adj=2.0. These settings attempt to milk trades for as much profit as possible and protect from loss by keeping T2 and T3 at BE after T1 exists. If Trade2 exits for any reason and Trade3 is still in the running, then Trade3 will have a SL= 0.5*TP.

If you manually close trades, it is best to manually close Trade1 last unless you want the SL=Breakeven to be active on the remaining trades.

Short version to remember: optimize Mode1 to optimize signal, optimize the T1adj T2adj T3adj to curve fit your profit.