| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Currency strength (like Hanover) https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=503 |
Page 3 of 11 |
| Author: | garyfritz [ Wed Apr 25, 2012 12:50 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
Close. |
|
| Author: | garyfritz [ Thu Apr 26, 2012 5:19 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
FYI I wanted to let people know I haven't abandoned this. I'm working on it, but Empty4's crapitude combined with my inexperience and screwups are making it slow going. I wrote up 3-4 big "sq, why is it doing THIS!?" posts but eventually I managed to figure most of them out. Right now I've got some bizarre behavior that causes the indicator to display the values for one period (about 1/24/11 to 3/7/11) repeatedly, about 6 times, before it "should" be displaying anything... but it doesn't do it consistently enough to figure out what's causing it. This rewrite is going about 10x harder than the previous ones for some reason. After about 4 hours of this I don't have any hair left to tear out but I'll try to work on it some more tomorrow night. |
|
| Author: | garyfritz [ Thu Apr 26, 2012 2:45 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
It's putting up a ferocious fight but I hope to beat it into submission eventually... |
|
| Author: | SteveHopwood [ Thu Apr 26, 2012 10:06 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Remember the Steve approach. Beat the damn thing over the head with a mallet until it gives up and slinks away. Mind, I don' t always know which particular blow did the trick and cannot always replicate it 6 months later. |
|
| Author: | garyfritz [ Thu Apr 26, 2012 10:11 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Just so long as the damn thing doesn't find its OWN hammer. It was beating me up pretty bad last night. |
|
| Author: | SteveHopwood [ Thu Apr 26, 2012 10:29 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Oh boy, I know how you feel. I know I should get to grips with indi coding, but I simply cannot face it. Up-an-at-em, tiger. |
|
| Author: | garyfritz [ Fri Apr 27, 2012 4:35 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
The basic idea of coding indicators is really very simple. Just declare buffers and place the values you want into them. For most simple indis, I suspect that is all that's required. I'm sure you could do it, Steve. It gets much more complicated when you're trying to use past values to calculate future values. I tried to carry values forward from one bar to the next, only to find the indi doesn't always execute the bars in consecutive order. Learning how to work around that took a while. Then complicate the issue further by pulling in 7 parallel data streams, calculating EMAs of array values (NOT price bars), and a few other bits & bobs, and it rapidly reaches the hair-pulling stage. I did not pick a simple challenge for my first indicator. Thank God for sq's advice or I would be jumping out the window! (Which wouldn't be terribly effective since I'm on the ground floor, but it might be satisfying.) Unfortunately I got pulled away tonight and did not get home until I'm half asleep. No hair pulling tonight. |
|
| Author: | garyfritz [ Fri Apr 27, 2012 9:49 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
I had a deadline this week and couldn't spend more time on this beastie. Now it's the weekend so I don't have any live ticks. That's how I got into trouble LAST weekend. But I wanted to post what I have for comment. Sq, your advice has been invaluable! Could you take a look at my current code and see what you think of it? I'm not sure I'm taking the right approach here. This is a complex setup and Empty4 is mighty particular about how you do things. I'm doing a multi-step calculation: * Gather 7 USD pairs and calculate raw currency-strength indexes * Optionally smooth the result with an EMA. * Optionally calculate "relative" values -- the deviation from a long EMA. This scales all the indexes into a similar range and gives you an indication of the direction it's moving. This is basically taking the first derivative to get the "speed" of the index. * Optionally calculate another level of relative value, basically getting the "acceleration" of the index. This will let us trade like the example I posted earlier, where you short while the index is going down, buy when it's going up. I have arrays for all of these -- for the 7 pairs, the raw index values, the relative "speed" values, and the smoothed speed. I calculate values for one, then use that array to calculate values for the next one, hoping to avoid any Empty4 surprises that way. The final "acceleration" value goes into the display buffer. Am I doing this the right way? It seems to me that it won't work when Empty4 invokes the indicator on just the last few bars, because the various arrays won't have the full history to do their EMAs &etc on. Or do they retain their values across calls since they're global? Or do I have to recalculate the ENTIRE buffer on each tick (or maybe just each bar) to ensure I've got valid data for the whole history? Stripped down, with just one currency for simplicity, here's what I'm doing. I've attached the full indicator if you want to look at all the grubby details. Merci beaucoup sq!!! Gary **EDIT: updated/cleaned up source, 05:00 GMT 4/28/12. Code: Select all |
|
| Author: | nanningbob [ Fri May 04, 2012 1:36 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
Gary I want you to know that I am very interested in your final product. Take your time, do it right but I really like what you are doing here. nanningbob |
|
| Author: | garyfritz [ Fri May 04, 2012 5:30 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
Thanks NB. I am unfortunately a bit stuck at the moment. I sent up a flare for sq (who has been an incredible help on this so far) but he hasn't gotten back to me yet. Between that, and being swamped up to my eyebrows with work (in, like, my real job, ick), I haven't been able to put any thought into it all week. I WILL get back to it, hopefully with a few pointers from sq. |
|
| All times are UTC | Page 3 of 11 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|