| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Currency strength (like Hanover) https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=503 |
Page 2 of 11 |
| Author: | squalou [ Mon Apr 23, 2012 7:51 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
Hi there.... I know exactly how you feel, Gary... Coding indicators is a very special activity, requiring a very special mindset, indeed You found your answer by yourself, and sometimes this is the best thing that can happen to you ! You MUST recalculate the EMA for each bar. Empty4 designers had their moment of lucidity ( However, don't think it is now a piece of cake... naaaa.... too easy... Because then their tortured minds came up with the ArraySetAsSeries() function... and you'll start pulling your hair again, believe me.... Fortunately enough, if you are playing with "buffers" as the input data, then you can use iMAOnArray() directly on the "buffers" at no extra brain cost... I let you play a bit with that function... However, that issue will be irrelevant when it comes to invoking the indicator from an EA, because iCustom() calls will reload and recalculate the indicator buffers every time, so it will give correct output buffer values at each call. BTW, nice and clean work on the indicator code! Sq |
|
| Author: | rebeljedi [ Mon Apr 23, 2012 11:08 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
hi garyfritz, besides the CCFp that Mediator mentioned, there is Complex Common indicator which also looks at currency strength. CCFp is a trend indicator whereas CC is a signal indicator for H4 timeframe. http://www.stevehopwoodforex.com/phpBB3 ... =450#p9716 http://articles.mql4.com/484 |
|
| Author: | garyfritz [ Mon Apr 23, 2012 2:50 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Thanks Mediator, I will see if I can learn anything from the CCFp code. Because of communities like this one. Steve and others are incredibly generous in sharing their ideas and their work. I grit my teeth and tolerate the steaming stinking pile of excrement that is Empty4 only because it lets me tap into this great source of inspiration and ideas. And I use Tradestation and other platforms for my "real" work. I don't trust Empty4 any further than I can throw it. It is badly-designed garbage. Thanks sq, I'll take a look at those suggestions! |
|
| Author: | SteveHopwood [ Mon Apr 23, 2012 6:08 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Now come on Gary. Stop beating around the bush, and say what you actually think. |
|
| Author: | garyfritz [ Mon Apr 23, 2012 6:44 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Oh trust me, that WAS beating about the bush. What I actually think would have made one of your profanity-laced rants look like a Sunday school lesson. |
|
| Author: | SteveHopwood [ Mon Apr 23, 2012 9:37 pm ] |
| Post subject: | Re: Currency strength (like Hanover) |
Booking my ringside seat. Two adults and a misc number of children depending on whichever of my pupils happen to be around and want to see some blood shed - that is all of them. Irreverent bunch, my lot. Seriously, you now understand why few of us attempt to tackle both indi and ea coding. My imagination boggles at what you are trying to do. |
|
| Author: | Fx93 [ Tue Apr 24, 2012 2:51 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
I just thought I'd mention that it is really easy to creatively build indicators on the thinkorswim platform. For example, I just overlaid the Standard Deviation and Standard Error indicators then plotted the difference between them, and it took like 5 minutes. So if you want to be creative fast, it's real nice. Of course, it won't help if you want to use the said indicator in an EA. |
|
| Author: | garyfritz [ Tue Apr 24, 2012 4:49 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
Oh... my... f***ing... GAWD. That's it. Now I'm certain. These guys are agents of the Devil, if not Lucifer incarnate himself. That's just hideous. Heinous. Any self-respecting programmer would hang these demonspawn by their dangly bits and use them for target practice. Then burn and bury their remains and salt the earth over it. I didn't think it was possible, but my opinion of Empty4's design just got even WORSE. Gawd, aaack ptui and BARF! *sigh* So, sq... Let's say I calculate values in array[] as I work through the bars. If I use ArraySetAsSeries(), the array gets indexed in the same order as buffers. So array[0] is the last (rightmost) element, corresponding to bar 0. Normally the order wouldn't really matter, unless you use something like iMAOnArray(). So after doing ArraySetAsSeries(array, true), if I use iMAOnArray() to do a 3-bar SMA ending at array[1], the MA will include the values from array[3], array[2], and array[1]... right? What if start() only gets called on bars 0 and 1, as it often does. array[3] and array[2] never got calculated!? How can iMAOnArray() calculate an SMA on them? Is it necessary to process the bars from oldest down to bar 0? (That seems to work a lot better!) It's slow going but I'm making progress. I think I'm close but it's not quite there yet. Merci beaucoup pour votre aide, sq!! |
|
| Author: | squalou [ Tue Apr 24, 2012 8:12 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
OK, now I am pulling my hair ! Order of elements doesn't matter if you stikc to SMA, which is symetrical. But if you want to calculate an EMA, then order does matter, because EMA is recursive: the newt element depends on the previous one, so you'd better be walking in the correct direction. What is really misleading in MQL explanations is that they use words like "from right to left", which really means nothing : where is element [0] in an array ? on the left, like any western person ever learned at school ? or is it on the right, like Empty4 "buffers" seem to be suggesting ?... When they say "from right to left", does this mean -1- in decreasing indexes (as you would expect on normal arrays that you would write down on a paper) ? or -2- is it increasing indexes if you consider that buffer[0] is the most recent value in the array, and you would write down on paper the buffer elements by starting with the oldest element on the left of the page, and finish with the most recent element (=buffer[0]) on the right of the page ??? The answer is : -1- : you always write the array or buffer on paper starting from index [0] on the left, then increasing indexes as you are moving to the right. Now, "buffers" (="series") will be evaluated "from right to left", meaning starting with the highest index first and going down, whereas "regular arrays" (non-"series") will be evaluated in increasing indexes, i.e from left to right. Does this seem more clear now ? A good example is worth a thousand words... Have a look at the default Empty4 Stochastic indicator code, it has the SMA on buffers part. Very straight forward. Code: Select all In you indicator, the first round of EMA smoothing is performed on buffers (the copied series of close prices), so you can use iMAOnArray() directly on those, using the same index value as the indicator output buffers. SQ |
|
| Author: | nanningbob [ Wed Apr 25, 2012 12:44 am ] |
| Post subject: | Re: Currency strength (like Hanover) |
HUH??? After reading this thread I have a question, Does it work now??? Duh ............... |
|
| All times are UTC | Page 2 of 11 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|