![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Trailing Stops - and Money Management
Three updates to the TS strategy in 5.7.2.w
1. Make it kick in at one point in profit.
2. Make a TP an equal number of pips above current price as TS is below point. This is so that if your computer loses it's connection to your broker,the trade will close itself once it hits the TS or the TP.
3. Make sure that the SL or TS is not too tight to make the trade illegal.
Also parameterize the new Decrease Factor in the Money Management Section. No Settings File changes.
Code Here
Change Signal 1?
Pcontour,
Not a bad idea about the SL kickin and TP/SL settings. I did not know that there was a problem with server connection loss as I thought the settings would stick nevertheless.
I wonder if it might not be a good idea to change Signal 1 from Envelope to the Malone Price Action Channel (two smoothed Moving Averages, no shift, period=5, applied to High and Low price of the bar). This would seem to be a more accurate way to follow the curve than the Envelopes, which seem to have inherent uncertainties. I notice in one of the forums that Hendrick did not feel the Envelope function was intuitive and he did not understand why the input took the values they did in backtesting. At least Price Action Channel would be more comprehensible, and possibly a more reliable predictor.
Indicators in Phoenix
Would it be possible to include indicators in the Phoenix EA itself? This would make it much easier to visualize how Phoenix behaves and make minor adjustments as we go. See the attached chart (3) for an example, where the signal lines and buy and sell signals are shown together. This chart also includes EASY indicators for comparison purposes.
On the blowup of this chart (4) Note that the buy entered by Phoenix at 115.61 comes a bar or so after EASY would have entered the trade, but the second trade comes just about in synchronization with EASY. Overall, in the optimization I have done Phoenix seems to be entering trades just a bit late for optimum performance. I have reduced ConsecutiveSignals to see if this can be improved, but some of the signal settings may also require fine-tuning.
Phoenix Timeframe
For improved accuracy in picking up trends, would it be possible to run Phoenix on a shorter timeframe, e.g., 5 minutes instead of 15?
If you change the timeframe, you need to change the signal data. It is theoretically possible to have the same exact trades executed by a 15 min to be executed by a 5 min timeframe. If P_SMA2Bars = 4 in 15 min timeframe, a good place to start would be P_SMA2Bars=12 in 5 min timeframe. If you hypothesize the best trades would be a value of 4.3 (an invalid number) then switching to a smaller timeframe would help, because it would correspond with a value of 9 in 5 min timeframe ( a valid number ).
Doing a full optimization (not Genetic Algo) on 5 minute timeframe for all values that are valid would take exponentially more time.
Meaning of signals
OK Darak, I'll stick with 15 minute timeframe until it becomes necessary to switch.
What do you think about replacing Signal 1 with a Price Action Channel? The Envelope is very difficult to figure out, and Hendrick even said he didn't understand the reason why the input values are so small.
Signal 2 is clear, but I'm also having difficulty grasping what happens with the OSMA in Signal 3. What are the meaningful events in the OSMA indicator: when it crosses zero, when it hits a peak (plus or minus) or something else?
Signal 4 is a complete mystery to me. I would like to be able to plot it on the chart as an indicator, but I don't even know where to start.
I think the indicators should be built into the EA.
Mode 3 - Trade 3
Good Health Daraknor,![](https://c.mql5.com/forextsd/smiles/hail.png)
My question is, When does trade 3 stoploss get changed and what does it get update to? What is that CalcPrice?
Pcontour,
Not a bad idea about the SL kickin and TP/SL settings. I did not know that there was a problem with server connection loss as I thought the settings would stick nevertheless.
I started off with a bad idea of making TP 999. So if your computer shut off, yes the settings would stick but you would never likely hit the TP of 999, only the SL would be likely. Now maybe it is 50/50.
What do you think about replacing Signal 1 with a Price Action Channel? The Envelope is very difficult to figure out, and Hendrick even said he didn't understand the reason why the input values are so small.
Can you post some references on price action channel? my google and mql4 search came up pretty empty. My metaquotes is still down and I feel half blind![](https://c.mql5.com/forextsd/smiles/frown.png)
iOsMA is checking rising or falling values. Our usage of iOsMA is nearly identical to the example online: http://docs.mql4.com/indicators/iOsMA Our key difference is the use of data 1 bar removed, rather than the current and previous bar. (Previous and the one before it) As for what it means, we are looking for a change in the slope of the slope. A second derivative in calculus terms. Putting your foot on the brake or gas relative to distance covered in practical (but not perfectly accurate) terms.
Signal 4 is entirely self contained.
{
int i;
double maF1, maF2, maS1, maS2;
maF2 = iMA(Symbol(), 0, F_Period, 0, MODE_SMA, F_Price, mypos + 1);
maS2 = iMA(Symbol(), 0, S_Period, 0, MODE_SMA, S_Price, mypos + 1);
return(maF2-maS2);
}
double diverge;
bool BuySignal4=false,SellSignal4=false;
diverge = Z_S4_Divergence(P_Fast_Period, P_Slow_Period, P_Fast_Price, P_Slow_Price,0);
if(U_UseSig4)
{
if(diverge >= P_DVBuySell && diverge <= P_DVStayOut)
{BuySignal4 = true;}
if(diverge = (P_DVStayOut*(-1)))
{SellSignal4 = true;}
}
I pulled code from two different sections of Phoenix 5.7.2 to show the whole picture. If you want to plot something in a window, I recommend plotting the value of "diverge" which is equal to maF2-maS2.
Here are my comments from the optimization thread, post 38:
!! 0,0.0002,0.005 !!
Sensitivity .0004-.0060. Recommend increment by .001-.002 for USDJPY.
Increasing number decreases trades.
Include in drawdown optimization
P_DVStayOut 024 026 063 0015 05
!!0,0.001,0.05 !!
Decreasing number decreases trades.
Include in drawdown optimization (appears to be critical for drawdown)
All of the indicators used were built into the EA, or provided with MQ4. Signal 4 was built in.
Good Health Daraknor,
I assume you are talking about 5.7.2 mode 3, trade 3.
M3_C_MoveSL_Trade_3_to_CalcPr() is the function name
CalcPrice = OrderOpenPrice()+NormalizeDouble((( OrderTakeProfit()-OrderOpenPrice())/2),Digits)- MarketInfo(Symbol(),MODE_STOPLEVEL)*Point;
In short, move half of the distance between tp & open price, plus a safety boundary = lock in half profit.