Phoenix - Development+Suggestions - MQ4 in Post#1 - page 12

 
Wackena:
I will try commenting out RefreshRates line.

Not sure, but I think this may be the problem. If OrderModify is like OrderSend, then it must have the spread difference between current Ask/Bid and new Stoploss level.

if(OrderProfit()>0) FirstTrade=true;[/CODE]

If OrderProfit is very low, OrderOpenPrice may be too close to current Ask/Bid, then the spread may come into play.

[CODE]OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,GreenYellow);

Again, not sure, just a thought.

The conditons for how this function is called make all of the difference here. Also the call OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),... is a quick breakeven code. The calling logic shouldn't call it twice. Thanks for looking into this with me Wackena.

 
Pcontour:

Quote:

Originally Posted by Pcontour

Background

I've been working in Computers for 25 years. I've developed programming standards myself. Your code is top notch.

Proposition

I would like to have a chance to apply a bunch of changes to your code to make it easier to understand for Forex beginners like myself and for people who are not coders. These would be user friendly changes. Nothing radical would make sense, as it's excellent already.

Benefits

1. It would be easier for you to find your own functions in your own program.

2. It would be easier for others to come up to speed and make some useful suggestions. I get confused at times and can't tell the difference between your functions and MT4 functions. People will have less questions.

3. Would give you a better base for future developments for both your code and other code that might be based on the same basic structure as your program.

4. The beauty of your code is how you could use the same phoenix strategy with different indicators. Your code getting to the point of plug and play, you can easily switch pieces.

5. Once you see what I do, you can improve on it in ways that I wouldn't think of.

6. If you don't like it, you don't have to use it.

What do I want

All I need is a window where you are not making changes, so I don't do work on the wrong version.

What I'm hoping for is a code base that anyone could work from to develop new Experts. We would benefit as a community if all the programs looked the same and we could look at and understand other peoples code and help each other out faster.

This is my way to contribute by doing what I'm good at.

I'm new to the forum and don't want to miss your reply so please mail me directly.

Quote:

Reply by Hendrick

Hi,

I like this very much:

"What I'm hoping for is a code base that anyone could work from to develop new Experts"

Have you visit the developers part of the Phoenix thread? At the moment I'm not working on Phoenix (I needed a break).

Reply by Pcontour

The code is attached with some additional information.

Tested to ensure the result were the same as before.

Tested Mode1, 2 and 3

Tested Mode 2 - close trade after x hours

Tested Mode 2 - close trade 1 when opening trade 2 (true and false)

I hope you like it.

This sounds (and looks) like great idea!

Mario

 

Use 5.6.7a instead of 5.6.7.

Removed adjustment to profit detection, made two segments more consistent. Same changelog applies.

Files:
 

Changelog 5.6.7

EDIT: Don't use this version. See next post for 5.6.7a. Keeping filed here for archive.

The latest bugfix version of Phoenix has been released. Wackena's logs and insight were very helpful. (Debugging exit strategies and waiting for a trade to close at a profit can take a while sometimes.)

changelog 5.6.7

Entire function CheckCloseAfterHours() is now commented out by default. Was previously disabled in 5.6.6

Mode3 SL code has a series of changes:

Set OrderProfit check on mode1 trade to be at least "10". If a dynamic value would be better, please suggest. Submitted by Wackena.

Relocated RefreshRates calls

Added and flagged error reporting on 2nd trade

If New SL is equal or worse to old SL value, don't modify the trade. This extra safety feature added after an immediate refresh rates call.

Added safe history feature to Trade3 history check. If trailing stops are used a higher value for total searched history may be better.

Files:
 
alamanjani:
This sounds (and looks) like great idea! Mario

His version isn't really 5.6.4, it is 5.6.3 with renamed variables and functions. Hopefully we will collaborate on development but I really would like to avoid renaming the variables for settings file compatiblity. Since we don't have any settings files posted at all, it is less of a concern :/

 
yeremeyv:
I did some testing of 5.6.7a, and I was a bit impressed by the low results, especially if comprared with earlier versions. Risk: 1.4; Currencies: USDJPY, EURUSD; Time periods: 2006.06.24->2006.12.06, 2005.06.24->2006.12.06; Broker: FXDD

The trade logic didn't change except for mode3. Mode3 should have functional stoplosses instead of invalid stoplosses. Since this issue is a rare condition (wait for first trade to exit in profit) I haven't been able to do great troubleshooting on it. Mode 1 and 2 should trade exactly the same.

 

I did some testing of 5.6.7a, and I was a bit impressed by the low results, especially if compared with earlier versions. Mode:3; Risk: 1.4; Currencies: USDJPY, EURUSD; Time periods: 2006.06.24->2006.12.06, 2005.06.24->2006.12.06; Broker: FXDD

 
daraknor:
His version isn't really 5.6.4, it is 5.6.3 with renamed variables and functions. Hopefully we will collaborate on development but I really would like to avoid renaming the variables for settings file compatibility. Since we don't have any settings files posted at all, it is less of a concern :/

The variable changes is the best part. Once I did it, I knew what was a user variable and what was a preferred setting instantly and I could change settings easily, and get things working faster. A major lesson in coding is that maintenance is what costs the most, so you spend more up front to get something more maintainable and then your save time and again after that. I didn't know that this was the thread with the latest code. Lets figure out when I could do the changes again to the latest version. Give everyone a break from doing new changes.

 
Pcontour:

Lets figure out when I could do the changes again to the latest version. Give everyone a break from doing new changes.

Lol and we get more time for some forward testing.

I really like the new way. It doesn't change anything but make it easier to use. We are hoping to get something special down the road. That way it will be something special also in 'user friendly' category. And since Pcontour is willing to do the work again...

I hope this wouldn't interfere with your code, which is already finished and it waiting to be used in Phoenix, Daraknor and I hope this could be done.

Mario

 
yeremeyv:

I did some testing of 5.6.7a, and I was a bit impressed by the low results, especially if compared with earlier versions. Mode:3; Risk: 1.4; Currencies: USDJPY, EURUSD; Time periods: 2006.06.24->2006.12.06, 2005.06.24->2006.12.06; Broker: FXDD

I checked and all PrefSettings are the same as in previous version. Here: https://www.mql5.com/en/forum/175571 (msg 19) you have all current original settings for easy comparism.

Maybe you want to check into MaxRisk. 0.05 would be default (conservative number) and 0.3 would be agresive number. Your 1.4 may be to much off, and may cause some unplaned results. May, dunno....

Btw, what 'zackly do you mean with low results? Less trades? Less proffit? Something else? First impression?

Mario