Currency strength (like Hanover)

Place your new trading idea here to see if someone can automate it.
Locked
User avatar
verb
Trader
Posts: 61
Joined: Mon Apr 02, 2012 2:27 am

Re: Currency strength (like Hanover)

Post by verb »

Looking through the code revision list, it appears the last person to revise was liloufx (liloufx@live.fr) on 2011/07/31.

Perhaps, you should just email him/her with the request to add NB10.2?
lonelytrader
Trader
Posts: 79
Joined: Wed Feb 29, 2012 1:29 pm
Location: Canada

Re: Currency strength (like Hanover)

Post by lonelytrader »

verb wrote:Looking through the code revision list, it appears the last person to revise was liloufx (liloufx@live.fr) on 2011/07/31.

Perhaps, you should just email him/her with the request to add NB10.2?
I will contact him after I see what Mr Hopwood thinks.
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

Meanwhile, back to the currency-strength indicator that this thread is actually about........... ahem :D

Still fighting with the code but it looks very promising. Here's an example of the indi running with a Smoothing length of 50, a "Speed" length of 50, and an "Acceleration" length of 10:
CurrStrength.gif
I tried an experiment: holding the pair indicated by the strongest and weakest currencies. E.g. at the left side of the chart, pink (NZD) is strongest, and green (EUR) is weakest, so you'd short EURNZD. I ran it on the D1 chart above. Results:

12/20/11 Short EURNZD: +1124 pips
1/18/12 Short GBPNZD: -121 pips
1/20/12 Long NZDUSD: +108 pips
1/24/12 Long NZDJPY: +18 pips
1/27/12 Long NZDUSD: +97 pips
2/9/12 Long NZDJPY: +210 pips
2/20/12 Long EURJPY: +274 pips
3/12/12 Long CADJPY: +57 pips
3/20/12 Long CHFJPY: -146 pips
3/22/12 short AUDCHF: +86 pips
4/3/12 Long GBPAUD: -91 pips
4/5/12 Short AUDJPY: +54 pips
4/19/12 Short NZDJPY: +547 pips (so far)

Total +2217 pips in 5 months, > 20 pips per day, 10 wins out of 13 trades. The losses happened when one pair was only active for a few days. You could trade this with almost zero effort -- glance at the chart once a day, and if the top/bottom pairs changed, close one position and open another.

I don't THINK it's repainting but I can't guarantee it yet.

That looks pretty darn promising. I suspect you could do even better if you added more pairs, e.g. 4 pairs holding the strongest 2 against the weakest 2, or 9 pairs holding the strongest/weakest 3. But it's a lot of work to hand-test this for one pair. I can't backtest this multi-symbol logic in Tradestation, so this needs a backtestable EA. (hint hint, Steve :lol:)

I hope to have an EA-callable function working by this weekend. Call it once per bar and it returns the values plotted above. This function will definitely NOT pull indicator-repainting tricks. Given that, it should be reasonably simple to write the trading logic for it. (He said, cluelessly)
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Currency strength (like Hanover)

Post by SteveHopwood »

garyfritz wrote:Meanwhile, back to the currency-strength indicator that this thread is actually about........... ahem :D
Hehe. Gary is not normally this reticent. For example, I usually allow dimwit contributors who have joined this forum merely to peddle their pathetic wares an opportunity to reform. Gary doesn't, and merely removes them. :lol:

It is sometimes harder to moderate one's own forum than it is to mod someone else's. So, to save Gary the pain of doing so, in future I shall delete irrelevant posts from this thread.
That looks pretty darn promising. I suspect you could do even better if you added more pairs, e.g. 4 pairs holding the strongest 2 against the weakest 2, or 9 pairs holding the strongest/weakest 3. But it's a lot of work to hand-test this for one pair. I can't backtest this multi-symbol logic in Tradestation, so this needs a backtestable EA. (hint hint, Steve :lol:)
I started to code an EA for your very first effort here, then 10.2 hit the screens and I was immediately diverted. You code the indi, and I will code the trader.
I hope to have an EA-callable function working by this weekend. Call it once per bar and it returns the values plotted above. This function will definitely NOT pull indicator-repainting tricks. Given that, it should be reasonably simple to write the trading logic for it. (He said, cluelessly)
Hehe. Welcome to my world. :lol: :lol:

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Fx93
Trader
Posts: 83
Joined: Mon Apr 09, 2012 6:32 pm

Re: Currency strength (like Hanover)

Post by Fx93 »

The indicator looks great! While I don't fully understand the rules of your backtest, the results are impressive and certainly hope that in time an EA is forged therefrom.

One thing I thought of is that you could plot the difference beween each line. It sounds crazy because there would be about 49 lines, but this would create a kind of stochastic oscillator, for instance one could buy when the slope of one of the lines begins to go positive.
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

The rules I was testing are simple. Pick the highest line and the lowest line. Combine those two currencies to produce a pair. If the first currency is the top line, go long; if it's the bottom line, go short. Close out that pair when you open the next pair.

At the start of the test the top/bottom lines are NZD (pink) and EUR (green). So you want to trade EURNZD. Since EUR first, and it's the lowest line, go short EURNZD. Then GBP (blue) briefly became the lowest line, GBP is first in the pair, so go short GBPNZD. Next USD becomes the lowest line, so you want to trade NZDUSD. NZD is the first in the pair, and it's the top line, so you go long NZDUSD. Etc.

Yes, plotting 28 lines (for 28 pairs) gets out of control pretty quickly. :D I've looked a bit at just going long XXXYYY when XXX crosses above YYY, and going short when XXX crosses below YYY, and doing that for all 28 pairs, keeping 28 pairs open at all times. I *think* it would work very well but it's hard to test.

Steve, I'll let you know when I get that non-indicator function working. :) I haven't had any time to work on it this week, and the last time I worked on it, it was causing me fits. But I'll keep pounding on it. For now I have to leave for the evening, so no work on it tonight...
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Currency strength (like Hanover)

Post by SteveHopwood »

garyfritz wrote:Steve, I'll let you know when I get that non-indicator function working. :) I haven't had any time to work on it this week, and the last time I worked on it, it was causing me fits. But I'll keep pounding on it. For now I have to leave for the evening, so no work on it tonight...
Gary, in my 'younger' days as a forum coder, I often felt pressure to produce EA's for people waiting with baited breath.

Eventually, I learned this: there is only one of me but there are lots of everyone else. I could drive myself into the ground trying to produce something that everyone else was waiting for.

Avoid doing this. Take your time. When you are tired, then stop. When you do not feel like doing any more, then do something else - find a miscreant to ban when you need real entertainment. :lol: If what you are trying to achieve here were easy, then someone else would already have done so. It isn't, so they haven't.

Feel no pressure to keep up with my rate of coding/admin. I do not have to work an 8 hour 'real job' day. I suspect that if I did, then this forum would not exist, because I would not have been able to make the contributions at FF that lead to its creation. 12 months from now, you will be creating indi's with the ease that I create auto-traders because you will have built up your own code base.

You are a star Gary, so relax and enjoy being so.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

Heh. Thanks for the kind words, Steve. It just frustrates the hell out of me that I can't make Empty4 behave.
garyfritz wrote:I've looked a bit at just going long XXXYYY when XXX crosses above YYY, and going short when XXX crosses below YYY, and doing that for all 28 pairs, keeping 28 pairs open at all times. I *think* it would work very well but it's hard to test.
I realized I COULD test this, one pair at a time, in Tradestation.

So I knocked out a TS currency-strength indicator -- which took all of 30 minutes, compared to the countless hours I've beat my skull against Empty4 to do the exact same thing. :twisted: That was a valuable exercise because it matched the Empty4 indicator within a percent or three, which is Close Enough. The differences could be explained by data differences &etc. So at least I know the Empty4 indicator is working right for history.

Then I wrote a system to test a single pair at a time (another 20 minutes). Unfortunately the results were uninspiring. Running it over the past year of H1 data, most pairs roughly broke even. That was disappointing.

Then I tried subtracting the two currency indexes. E.g. if I'm testing AUDUSD, I looked at AUDIndex - USDIndex. If that difference is increasing, go long, else go short. So e.g. if AUD is going up and USD is going down, you'll want to be long, and vice versa. That looks more promising but I'll have to poke at it some more to see if it's worth pursuing.
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

Re: Currency strength (like Hanover)

Post by mobthehop »

Hi Gary,

1. You may have glanced over my brief exchange with SQ on page 5 ff - those EA's / indys I mentioned are based on Hi / Low of a certain period of time in the past - how does your calculation (aside from smoothing) differ?

2. If it is not too much work and your time permits, could you run another back test on TS? I assume that you also end up with an assigned numerical scale for each currency (eg 0 = low / 10 = high). Only use top and bottom 10% of your scale, select only pairs where currency A (strong) is in upper 10% range, currency B (weak) which is within lower 10% - close when strong currency falls below 15% from top or weak currency raises above 15% from bottom.

Like to apologize already now if I mis-understood the working of your indicator

Thanks for the work you put into this

Mop
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

Mop, in a quick glance at Xmeter, I can't tell what kind of strength calculation it's doing. Mine is based on the Close of each bar.

In the TS test I did last night, I tested one pair at a time. The first test was "if trading pair XXXYYY, then if XXX strength > YYY strength, go long, else go short." That didn't work too well. The second test was "if XXXstrength-YYYstrength is increasing, go long, else go short." I didn't pay attention to the top 10% or bottom 20% or anything like that.

For the hand-test I did earlier, I said "look at the indicator and find the highest (HHH) and lowest (LLL) strength values. If HHHLLL is a legal pair, go long HHHLLL. If LLLHHH is a legal pair, go short LLLHHH." Again, didn't pay attention to ranges or bands, just looked at the highest and lowest.

More involved approaches may work better, but I haven't tested them yet.
Locked

Return to “Ideas for Possible Automation”