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

 
 
daraknor:
Nicholishen, very nice code and use of string matching with arrays. Tutorials would benefit by having examples like that one. I really miss the array functions of PHP and Python in MT4 but we can still get the job done.

It looks like this code could be dropped in to Phoenix with very minor modifications. I would make the deposit currency an external variable, and make the final calculations mini-account safe. That way we have a true percentage on both account types and the mini-account people can set their own requirements.

It would be nice to have a risk function that is a true percentage instead of a percentage when currencies correspond. Do we have your permission to include this in Phoenix 5.7.x or 6? I want to do a feature freeze on 5.7.x and just do bugfixes only, but that code is both beautiful and compelling. I also admire it so much I wouldn't want to write my own version, a true indication of elegance.

Great observation and code Nicholishen!

No problem. I have also posted a different version of this for hedging and multi-leg trading. here: https://www.mql5.com/en/forum/175962

 

Request/suggestion: Is there a way to avoid having the EA draw the BUY/SELL & SL/TP lines on the chart or at least restrict them to just the chart the EA is actually attached to?

For instance, if you have a USD/JPY position opened by the EA, then the buy/sell and TP/SL lines show up on EVERY USD/JPY chart you open. It can be annoying if you are doing other stuff and using other indicators...

Minor request, just wondering... Thanks!!

 
Nicholishen:
This is only correct in the instance that the currency you have on deposit is the same as the Base currency in the pair that you are trading. 90% of EA programmers neglect to take the extra step to factor in the the currency conversion needed to equate everything to depost_currency.

yeah! i forgot about that! that's why it was always off a few bucks when i manually calculated the lot size

can you update your function a little bit?

when used with a mini account the "symb" parameter will hold a value of "XXXYYYm". can you strip off that 'm' at the end (if there is one) to make it work for mini accounts as well?

ciao,

AZBOfin

 
AZBOfin:
yeah! i forgot about that! that's why it was always off a few bucks when i manually calculated the lot size

can you update your function a little bit?

when used with a mini account the "symb" parameter will hold a value of "XXXYYYm". can you strip off that 'm' at the end (if there is one) to make it work for mini accounts as well?

ciao,

AZBOfin

Yeah just add this as the first lne of code.

if(StringSubstr(symb,6,1)=="m")symb=StringSubstr(symb,0,6);

 
Pipskateer:
Request/suggestion: Is there a way to avoid having the EA draw the BUY/SELL & SL/TP lines on the chart or at least restrict them to just the chart the EA is actually attached to?

For instance, if you have a USD/JPY position opened by the EA, then the buy/sell and TP/SL lines show up on EVERY USD/JPY chart you open. It can be annoying if you are doing other stuff and using other indicators...

Minor request, just wondering... Thanks!!

Hi Pips! I believe that is the way MetaTrader works and nothing we can do about it, except suggest that to MetaQuotes (http://www.metaquotes.net.

-RJ1-

 
Pipskateer:
Request/suggestion: Is there a way to avoid having the EA draw the BUY/SELL & SL/TP lines on the chart or at least restrict them to just the chart the EA is actually attached to?

For instance, if you have a USD/JPY position opened by the EA, then the buy/sell and TP/SL lines show up on EVERY USD/JPY chart you open. It can be annoying if you are doing other stuff and using other indicators...

Minor request, just wondering... Thanks!!

You can try removing the color from the OrderSend function. By removing the last comma and the red or green part the graphic should not display. Hopefully the lines won't appear either.

 

you can also go to the chart properties and change the sl/tp line color to the same as the chart background...

 

I have been tinkering more with 5.7.2 here and there, and I added a filter that cuts optimization time on P_Fast_Period and P_Slow_Period by 1/3. The filter doesn't trade at all if Fast+5>Slow, preventing the values from being too close (which ignores the signal) or reversed.

The optimization thread contains my notes on each signal, and what values are of interest. Some values have no trades at all with a 0 or 1, and so sane limits were included in the optimization file. The min/max range of values is dependent on USDJPY, but doesn't violate any of the existing settings (it could have found any of the other settings too). I think this makes it a set of sane values worth using as a basis for optimization.

An optimization tutorial is being updated, and 5.7.2 will probably have much shorter variable names so the entire list of settings can be saved from "Optimization Results", instead of the optimized settings only. (816 character limit)

Trailing Stop and Break even code work together safely in 5.7.2

After the variable renaming (shorter but still in the new style) is complete, should we release the code? Aside from TS/BE edits, the changes will only affect people doing optimizations and sharing settings.

 

Ahead to 5.7.2??

I would be in favour of going to 5.7.2 once all the issues it is designed to address have been resolved satisfactorily, AND if people really need to go on to test TS and BE.

After a couple of weeks trying to fathom what was going on with TS and BE, I have abandoned that tack and gone back to optimizing 5.7.1 signals only, but on a single day for each run, at the suggestion of a physicist friend who thinks that long term testing would spread the data too far from the natural frequency of the ripples in the wavechart. I'm taking about a dozen individual days and creating histograms to identify most frequent values for each input on the top 3000 or so passes. So far I am not too impressed with the outcome, as there is still significant variation in each input. However, perhaps this is due to the large number of passes or other factors. Will keep you posted, but do send along any suggestions.

Reason: