Phoenix optimization - page 12

 
XOLOSIS:
Firstly great work by everyone involved. What currency pairs did you use for these results? I've downloaded the required and read through everything I could get my hands on. I wish to begin testing.

Sorry, I use GBP/USD

 
Pcontour:
A couple people were asking why when they set the TS does the trade kick out at a profit of 42. I updated my 5.7.2.W version, to make that happen for Mode1.

The results were great 42% better in my one little test.

These were the best results I've seen with any coding change I've tried.

The code is here, if someone would run this on one of their favorite test beds of data, I would be interested to know if this change is really as good as I'm saying. I attached my settings file, nothing special about it. I just optimized one field P_M1_TS, and had the pref settings true, mode 1 and used GBPUSD.

Daraknor this is a really simple change. I marked the lines with "- pcontour TS update"

I was wandering if it is possible to have a TS that would decrease as the profit (pips) increases over the initial 42 TP ? Let me know if the idea is interesting or not...

 

Visual optimization on charts

Hi Daraknor,

Thanks for your response. I would like to do all my future optimization using Tester in tandem with the indicators on the chart. I have succeeded in putting Envelopes on the chart, and this helps a great deal in understanding the way signal 1 operates. A Signal 2 indicator is also on the chart, but I'm having a problem understanding how the signal operates, as the "Ultimate Guide" is confusing on this point. (See below) I wonder if you would mind clarifying exactly how Signal 2 comes into action.

From the Guide (unclear):

Signal 2 - Moving Average Comparison 1 - Counter Trend Signal

"Two moving averages are calculated using the same time period P_SMAPeriod. The first is for the present timeframe, and the second is for a point in the past, which is a certain number of bars previous.

If the older MA is greater than the present one that indicates a downtrend price trend. but Phoenix produces a Buy Signal

If the older MA is greater than the present one that indicates a downtrend price trend. but Phoenix produces a Buy Signal"

 

PContour, I didn't see any changes listed. I thought I was facing a simple operating system issue, but it appears that my file system is turning to mush. I used to do data recovery techniques and I should be able to salvage most of my data, but I need a new HD :/ So for a little while, I'm going to be writing code blind, and answering questions semi-blind.

It sounds like the optimization is based on the trailing stop changes in 5.7.2? I saw the use of trailing stop P setting overriding the defaults. (Good quick code hack for doing tests without changing the settings file.) Since we have a countertrend system, this probably acts a filter for weak profits where the signal was good.

If I understand correctly (and I am doing this half blind) the system works like this:

If trade is 1 pip profitable, activate trailing stop

Use a 30-45 pip trailing stop so the initial SL=-29 to -44 profit.

As the profits increase, move the trailing stop up.

Have a 999 pip take profit, so the trailing stop is able to run the entire range.

I see a few problems with the system I just described (and I could be wrong on description).

#1 We have (by using backtesting) already removed some of the news based SL. When we profit using this trailing stop, we are really taking full advantage of news events in our favor and maybe a few minor trends. (Not bad, but please keep in mind that backtest looks much better than forward test.)

#2 In order to get a profit of 20 pips with a ts of 40, we need to have had a potential profit of 60 pips and we leave 2/3 of that on the table.

An ideal system of this type would:

A) Reduce losses when profit was reached, but in much smaller amounts than predicted.

B) Not leave so much profit on the table every trade.

C) Have enough cushion to allow Phoenix to operate and wait for larger trade reversals. (A tight trailing stop does A and B, but fails C)

D) Work well with all brokers (Brokers have a different valid 'smallest trailing stop' value and a separate different valid 'smallest stop loss' value.)

E) Not loose drastically when disconnected. (I'm solving E by staying connected all of the time personally with a hosted account, but it is still a criteria.)

I wrote a post about different exit strategies. Phoenix 5.7.2 can handle some variations, but it isn't really equipped to handle Exit Strategies well. A few months ago, I wrote some examples of different exit strategies, and I learned Pip Boxer implemented some of them. Phoenix 6 has almost 400 lines of code, not including any trading signals yet. Phoenix6 allows signals or simple math to be used for exit strategies, and to have several different exits turned off or on. I'm writing blind, but I'm writing every day.

 
autumnleaves:
Hi Daraknor,

Thanks for your response. I would like to do all my future optimization using Tester in tandem with the indicators on the chart. I have succeeded in putting Envelopes on the chart, and this helps a great deal in understanding the way signal 1 operates. A Signal 2 indicator is also on the chart, but I'm having a problem understanding how the signal operates, as the "Ultimate Guide" is confusing on this point. (See below) I wonder if you would mind clarifying exactly how Signal 2 comes into action.

From the Guide (unclear):

Signal 2 - Moving Average Comparison 1 - Counter Trend Signal

"Two moving averages are calculated using the same time period P_SMAPeriod. The first is for the present timeframe, and the second is for a point in the past, which is a certain number of bars previous.

If the older MA is greater than the present one that indicates a downtrend price trend. but Phoenix produces a Buy Signal

If the older MA is greater than the present one that indicates a downtrend price trend. but Phoenix produces a Buy Signal"

I would explain Signal 2 as "A trading signal sensitive to changes in MA over time, similar to a derivative of the slope in price. Magnitude is ignored in Phoenix 5, only direction of change is used for trading."

Restating the previous description minus the error in double paste:

If the Period MA is greater than the current bar MA that indicates a downward price trend but Phoenix produces a Buy Signal

If the Period MA is less than the current bar MA that indicates an upward price trend but Phoenix produces a Sell Signal

 
m6m6:
I was wandering if it is possible to have a TS that would decrease as the profit (pips) increases over the initial 42 TP ? Let me know if the idea is interesting or not...

It is interesting, and something I wrote about other places. Other people are welcome to write it as a hack on Phoenix 5, but I'm going to include a clear way of doing it in Phoenix6. I have trailing stops using different parameters, including a parabolic trailing stop now.

 
daraknor:
It is interesting, and something I wrote about other places. Other people are welcome to write it as a hack on Phoenix 5, but I'm going to include a clear way of doing it in Phoenix6. I have trailing stops using different parameters, including a parabolic trailing stop now.

Great work again Daraknor !

I hope you get back all data on your hard drive so you can see again...

 

Thank You

For doing some testing on this.

m6m6:
I was wandering if it is possible to have a TS that would decrease as the profit (pips) increases over the initial 42 TP ? Let me know if the idea is interesting or not...

The issues

When you go with a lower TS you get kicked out more easily as waves happen in the down direction, so you may miss that killer score, if it dips 20 cuts you out and sours another 100 or more pips. The lower the TS is the more you can loose on the up side and the less you lose on the downside. We don't understand how much we leave on the table, unless you examine every single trade, we optimize instead and we learn if we are thinking straight from the results.

I don't want to introduce any new variables.

I could use a big hack and borrow a variable from Mode 2 or 3. (The only possibility I can think of if you want to optimize and I don't bring in a new variable.) But it can mess up other things.

So lets say I try something like what you say, as the pips in profit comes back down, I don't want to accidentally increase the TS.

I need to come up with some formula for tightening the stop. Here is my idea for every X pips above 0 profit I cut the TS by 1. I'm curious to see if the less you cut the TS the better you do.

I made the 999 configurable for my own tests, but just found the higher the better. Interesting but not relevant to the TS tightening idea.

I will give it a little thought to above.

 
m6m6:
If the Take Profit would be increased by an optimized value, we may even get better results as the market usually reverse itself meaning that, with a TP of 999, we are sure to eventually loose the 35 pips of the TS.

I tried that, and it seemed the higher the better. I did have an error in my coding at the time, but I was getting almost the same results. I like the suggestion of tightening the TS better as we get higher into the profit. In my original optimization I found TS of 45 to give me the best result. The more data the better the long term results I only ran my tests on 7 weeks of data.

I also made a variable that I optimized to say how much in the profit should I be before i put the trailing stop into action. It didn't matter, even when I only turned it on at 40 pips in the profit, I had the same profit as when I did it at 0 pips. I have stupid data perhaps.

 

Signal 3 Visualization

I would like to add an indicator for Signal 3 to my charts. If I understand correctly, this would require using the Moving Average of Oscillator, but it uses two sets of bars, whereas the indicator only has one. I am not sure how to add the extra set of bars.

In other words, how can the definitions in Phoenix code below be illustrated as an indicator on a chart?

Thanks for any help with this.

Code:

OsMABar2=iOsMA(NULL,0,P_OSMAFast,P_OSMASlow,P_OSMASignal,PRICE_CLOSE,2);

OsMABar1=iOsMA(NULL,0,P_OSMAFast,P_OSMASlow,P_OSMASignal,PRICE_CLOSE,1);

Reason: